diff --git a/DEPS b/DEPS index f73ad407db9a..e7a3f86370c6 100644 --- a/DEPS +++ b/DEPS @@ -9,7 +9,6 @@ deps = { "vendor/python-patch": "https://github.com/brave/python-patch@d8880110be6554686bc08261766538c2926d4e82", "vendor/omaha": "https://github.com/brave/omaha.git@de118d8511e4754a673d44a9f1e92d80442069e7", "vendor/sparkle": "https://github.com/brave/Sparkle.git@198b1f7930d3fb036eaae7a0eae34ec63ef4f479", - "vendor/speedreader_rust_ffi": "https://github.com/brave-experiments/speedreader-rust-ffi.git@9237e8ac4e6fd06548177a7065681a4efabcc239", "vendor/bat-native-rapidjson": "https://github.com/brave-intl/bat-native-rapidjson.git@86aafe2ef89835ae71c9ed7c2527e3bb3000930e", "vendor/bip39wally-core-native": "https://github.com/brave-intl/bip39wally-core-native.git@13bb40a215248cfbdd87d0a6b425c8397402e9e6", "vendor/bat-native-anonize": "https://github.com/brave-intl/bat-native-anonize.git@e3742ba3e8942eea9e4755d91532491871bd3116", diff --git a/browser/brave_content_browser_client.cc b/browser/brave_content_browser_client.cc index 44f8c6ea8b46..6393e55107b0 100644 --- a/browser/brave_content_browser_client.cc +++ b/browser/brave_content_browser_client.cc @@ -294,6 +294,7 @@ BraveContentBrowserClient::CreateURLLoaderThrottles( && request.resource_type == static_cast(content::ResourceType::kMainFrame)) { result.push_back(std::make_unique( + g_brave_browser_process->speedreader_whitelist(), base::ThreadTaskRunnerHandle::Get())); } #endif // ENABLE_SPEEDREADER diff --git a/browser/speedreader/speedreader_browsertest.cc b/browser/speedreader/speedreader_browsertest.cc index 00b87da8d76c..4ecbe49b1963 100644 --- a/browser/speedreader/speedreader_browsertest.cc +++ b/browser/speedreader/speedreader_browsertest.cc @@ -3,21 +3,23 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "brave/components/speedreader/speedreader_switches.h" - #include "base/bind.h" #include "base/path_service.h" #include "brave/app/brave_command_ids.h" #include "brave/common/brave_paths.h" +#include "brave/components/speedreader/speedreader_switches.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_commands.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" +#include "components/network_session_configurator/common/network_switches.h" #include "content/public/test/browser_test_utils.h" #include "net/dns/mock_host_resolver.h" #include "net/test/embedded_test_server/embedded_test_server.h" +const char kTestHost[] = "theguardian.com"; const char kTestPage[] = "/guardian.html"; +const char kTestWhitelist[] = "speedreader_whitelist.json"; class SpeedReaderBrowserTest : public InProcessBrowserTest { public: @@ -26,7 +28,7 @@ class SpeedReaderBrowserTest : public InProcessBrowserTest { brave::RegisterPathProvider(); base::FilePath test_data_dir; base::PathService::Get(brave::DIR_TEST_DATA, &test_data_dir); - + https_server_.SetSSLConfig(net::EmbeddedTestServer::CERT_OK); https_server_.ServeFilesFromDirectory(test_data_dir); EXPECT_TRUE(https_server_.Start()); } @@ -38,6 +40,14 @@ class SpeedReaderBrowserTest : public InProcessBrowserTest { void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(speedreader::kEnableSpeedreader); + base::FilePath test_data_dir; + base::PathService::Get(brave::DIR_TEST_DATA, &test_data_dir); + base::FilePath whitelist_path = test_data_dir.Append(kTestWhitelist); + command_line->AppendSwitchPath(speedreader::kSpeedreaderWhitelistPath, + whitelist_path); + // HTTPS server only serves a valid cert for localhost, so this is needed + // to load pages from other hosts without an error + command_line->AppendSwitch(switches::kIgnoreCertificateErrors); } void SetUpOnMainThread() override { @@ -50,25 +60,24 @@ class SpeedReaderBrowserTest : public InProcessBrowserTest { IN_PROC_BROWSER_TEST_F(SpeedReaderBrowserTest, SmokeTest) { chrome::ExecuteCommand(browser(), IDC_TOGGLE_SPEEDREADER); - const GURL url = https_server_.GetURL(kTestPage); + const GURL url = https_server_.GetURL(kTestHost, kTestPage); ui_test_utils::NavigateToURL(browser(), url); content::WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); content::RenderFrameHost* rfh = contents->GetMainFrame(); - const char kGetStyle[] = - "document.getElementById(\"brave_speedreader_style\").innerHTML"; + const char kGetStyleLength[] = + "document.getElementById(\"brave_speedreader_style\").innerHTML.length"; - const char kGetContent[] = "document.body.innerHTML"; + const char kGetContentLength[] = "document.body.innerHTML.length"; // Check that the document became much smaller and that non-empty speedreader // style is injected. - EXPECT_LT(0ull, content::EvalJs(rfh, kGetStyle).ExtractString().size()); - EXPECT_GT(4096ull, content::EvalJs(rfh, kGetContent).ExtractString().size()); + EXPECT_LT(0, content::EvalJs(rfh, kGetStyleLength)); + EXPECT_GT(17750 + 1, content::EvalJs(rfh, kGetContentLength)); // Check that disabled speedreader doesn't affect the page. chrome::ExecuteCommand(browser(), IDC_TOGGLE_SPEEDREADER); ui_test_utils::NavigateToURL(browser(), url); - EXPECT_LT(106000ull, - content::EvalJs(rfh, kGetContent).ExtractString().size()); + EXPECT_LT(106000, content::EvalJs(rfh, kGetContentLength)); } diff --git a/browser/speedreader/speedreader_tab_helper.cc b/browser/speedreader/speedreader_tab_helper.cc index b39cf39a7d2a..fcc645277c1a 100644 --- a/browser/speedreader/speedreader_tab_helper.cc +++ b/browser/speedreader/speedreader_tab_helper.cc @@ -38,6 +38,7 @@ void SpeedreaderTabHelper::UpdateActiveState( auto* whitelist = g_brave_browser_process->speedreader_whitelist(); if (speedreader::IsWhitelistedForTest(handle->GetURL()) || whitelist->IsWhitelisted(handle->GetURL())) { + VLOG(2) << __func__ << " SpeedReader active for " << handle->GetURL(); active_ = true; return; } diff --git a/build/cargo.gni b/build/cargo.gni index 8177fc5c078a..c08165cd88f3 100644 --- a/build/cargo.gni +++ b/build/cargo.gni @@ -2,10 +2,16 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. +import("//brave/build/rust/config.gni") + if (is_mac) { import("//build/config/mac/mac_sdk.gni") } +declare_args() { + rustup_path = rebase_path("//brave/build/rustup/", root_build_dir) +} + # Runs a script to compile a local Cargo package and all of its dependencies template("cargo_build") { action(target_name) { @@ -16,12 +22,17 @@ template("cargo_build") { outputs = [output] + if (!defined(target)) { + target = rustc_target # defined by //brave/build/rust/config.gni, + } + args = [ - "--rustup_path=" + rebase_path("//brave/build/rustup/", root_build_dir), - "--cargo_path=" + rebase_path("//brave/build/rustup/", root_build_dir), + "--rustup_path=" + rustup_path, + "--cargo_path=" + rustup_path, "--manifest_path=" + rebase_path(manifest_path, root_build_dir), "--build_path=" + rebase_path(build_path, root_build_dir), "--target=" + target, + "--toolchain=" + rustc_toolchain, # defined by //brave/build/rust/config.gni, "--is_debug=$is_debug" ] @@ -29,9 +40,39 @@ template("cargo_build") { args += [ "--mac_deployment_target=" + mac_deployment_target ] } - if (defined(invoker.rust_flags)) { + if (defined(ldflags)) { + rust_flags += " -C link-args=${ldflags} " + } + + if (defined(rust_flags)) { args += [ "--rust_flags=$rust_flags" ] } } } + +# Runs a script to generate C bindings for rust library +template("cargo_cbindgen") { + action(target_name) { + script = "//brave/script/cargo_cbindgen.py" + + forward_variables_from(invoker, ["config", "sources", "output"]) + + assert(defined(config), "Must specify cbindgen.toml config to use") + assert(defined(sources), "Must specify sources to generate bindings for") + assert(defined(output), "Must specify output header file") + + sources += [ + config, + ] + outputs = [ output ] + + args = [ + "--rustup_path=" + rustup_path, + "--cargo_path=" + rustup_path, + "--config=" + rebase_path(config, root_build_dir), + "--path=" + rebase_path(get_path_info(config, "dir"), root_build_dir), + "--output=" + rebase_path(output, root_build_dir), + ] + } +} diff --git a/build/rust/config.gni b/build/rust/config.gni new file mode 100644 index 000000000000..8d418d32a742 --- /dev/null +++ b/build/rust/config.gni @@ -0,0 +1,85 @@ +# Copyright 2020 The Brave Authors. All rights reserved. +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this file, +# You can obtain one at http://mozilla.org/MPL/2.0/. */ + +import("//build/config/sysroot.gni") + +declare_args() { + rust_flags = "" + rustc_target = "" + rustc_toolchain = "" + cargo_lib_prefix = "" + cargo_lib_suffix = "" + rust_shared_lib = is_mac +} + +# See https://forge.rust-lang.org/release/platform-support.html for possible targets +if (is_win) { + if (current_cpu == "x86") { + rust_flags += " --codegen target-feature=+crt-static " + rustc_target = "i686-pc-windows-msvc" + } else if (current_cpu == "x64") { + rustc_target = "x86_64-pc-windows-msvc" + } +} else if (is_mac) { + if (current_cpu == "x64") { + rustc_target = "x86_64-apple-darwin" + } +} else if (is_linux) { + if (current_cpu == "x64") { + rustc_target = "x86_64-unknown-linux-gnu" + if (use_sysroot) { + rust_flags += " -C link-arg=--sysroot=$target_sysroot " + rust_flags += " -C link-arg=-Wl,-rpath=\$ORIGIN " + } + } +} else if (is_android) { + if (current_cpu == "arm") { + rustc_target = "arm-linux-androideabi" + rustc_toolchain = "arm" + } else if (current_cpu == "arm64") { + rustc_target = "aarch64-linux-android" + rustc_toolchain = "arm64" + } else if (current_cpu == "x86") { + rustc_target = "i686-linux-android" + rustc_toolchain = "x86" + } else if (current_cpu == "x64") { + rustc_target = "x86_64-linux-android" + rustc_toolchain = "x86_64" + } +} else if (is_ios) { + if (current_cpu == "arm64") { + rustc_target = "aarch64-apple-ios" + } else if (current_cpu == "x64") { + rustc_target = "x86_64-apple-ios" + } +} + +cargo_lib_prefix = "" + +if (rustc_target != "") { + cargo_lib_prefix += rustc_target +} + +if (is_debug) { + cargo_lib_prefix += "/debug" +} else { + cargo_lib_prefix += "/release" +} + +cargo_lib_suffix = "" +if (is_win) { + cargo_lib_prefix += "/" + cargo_lib_suffix = ".lib" +} else if (is_linux || is_android || is_ios) { + cargo_lib_prefix += "/lib" + cargo_lib_suffix = ".a" +} else if (is_mac) { + cargo_lib_prefix += "/lib" + if (rust_shared_lib) { + cargo_lib_suffix = ".dylib" + } else { + cargo_lib_suffix = ".a" + } +} diff --git a/components/speedreader/BUILD.gn b/components/speedreader/BUILD.gn index b5762d7118d8..17c22f20eade 100644 --- a/components/speedreader/BUILD.gn +++ b/components/speedreader/BUILD.gn @@ -1,6 +1,5 @@ import("//build/buildflag_header.gni") import("//brave/components/speedreader/buildflags.gni") -import("//brave/vendor/speedreader_rust_ffi/config.gni") buildflag_header("buildflags") { header = "buildflags.h" @@ -10,9 +9,12 @@ buildflag_header("buildflags") { } source_set("speedreader") { + public_deps = [ + ":buildflags", + "rust/ffi:speedreader_ffi_lib", + ] + sources = [ - "speedreader_loader.cc", - "speedreader_loader.h", "speedreader_pref_names.h", "speedreader_service.cc", "speedreader_service.h", @@ -21,6 +23,8 @@ source_set("speedreader") { "speedreader_test_whitelist.h", "speedreader_throttle.cc", "speedreader_throttle.h", + "speedreader_url_loader.cc", + "speedreader_url_loader.h", "speedreader_whitelist.cc", "speedreader_whitelist.h", ] @@ -28,32 +32,10 @@ source_set("speedreader") { deps = [ "//brave/components/brave_component_updater/browser", "//brave/components/resources", - "//brave/components/speedreader:buildflags", - "//brave/vendor/adblock_rust_ffi:adblock_ffi", - "//brave/vendor/speedreader_rust_ffi:speedreadder_ffi", "//services/network/public/cpp", "//services/network/public/mojom", "//ui/base", # For ResourceBundle, consider getting rid of this? "//url", + "rust/ffi:speedreader_ffi", ] - - public_deps = [ - ":speedreader_libs" - ] -} - -if (is_mac) { - bundle_data("speedreader_libs") { - sources = [ - speedreader_lib_path, - ] - outputs = [ - "{{bundle_contents_dir}}/Libraries/{{source_file_part}}", - ] - public_deps = [ - "//brave/vendor/speedreader_rust_ffi:speedreader", - ] - } -} else { - group("speedreader_libs") {} } diff --git a/components/speedreader/resources/speedreader-desktop.css b/components/speedreader/resources/speedreader-desktop.css index 6c6c67783633..25d4ab047e7e 100644 --- a/components/speedreader/resources/speedreader-desktop.css +++ b/components/speedreader/resources/speedreader-desktop.css @@ -1,207 +1,418 @@ -html { - background-color: #f4f4f4; -} -body { - font-size:100%; - line-height:1.5; - font-family: 'Merriweather', Georgia, 'Times New Roman', Times, serif; - background-color: white; +h1, h2, h3, h4, h5, h6 { + font-weight: bold; } + h1 { - font-size: 2.747em; + font-size: 2em; + line-height: 1em; + margin-top: 0; + margin-bottom: 0.5em; } + h2 { - font-size: 0.874em; + font-size: 1.5em; + line-height: 1em; } + h3 { - font-size:1.229em; + font-size: 1.5em; + line-height: 1em; } -body { - max-width:34em; - margin:auto; - padding:2em 1em; - margin-bottom: 5em; - margin-top: 2em; + +h4, h5, h6 { + font-size: 1.5em; + line-height: 1em; + margin: 1em 0; } -@media screen and (max-width: 25em) { - body { font-size: 90%;} + +p { + font-size: 1em; + line-height: 1.5em; } -h1 { - font-size: 1.25em; +.subhead { + font-weight: normal; } -h2 { - font-size: 1.125em; +.subhead, .subheading { + font-size: 1.5em; + line-height: 1em; + font-weight: normal; + color: rgba(27, 27, 27, 0.65); } -h3 { - font-size: 1.05em; +.metadata { + margin-top: -0.75em; + margin-bottom: 1.45em; } -h4, h5, h6 { - font-size: 1em; - margin: 1em 0; +.metadata * { + font-size: 1em !important; + font-weight: normal !important; + font-style: normal !important; + display: inline !important; + margin: 0; } -figure { - margin: 0; +.metadata :matches(.byline, .date) { + display: inline !important; } -.page.rtl { - direction: rtl; +.metadata :matches(ul, ol, li) { + list-style-type: none; + -webkit-padding-start: 0; } -body { - text-rendering: optimizeLegibility; +.title+.metadata { + margin-top: -0.75em; } -body pre { - white-space: pre-wrap; +.subhead+.metadata { + margin-top: -0.7em; } -body * { - /* Scale down anything larger than our view. Max-width maintains aspect ratios on images. */ - max-width: 100%; +a { + text-decoration: none; } -body img { - /* By default, images are centered on their own line. */ - margin: 0.5em auto; - display: block; - height: auto; +a[href] { + color: rgb(65, 110, 210); } -body p { - /*padding-bottom: 1em;*/ +#article { + text-rendering: optimizeLegibility; + font-family: "Times New Roman", Times, serif; } -body > div { - margin-block-start: 1em; - margin-block-end: 1em; + +#article * { + /* Scale down anything larger than our view. Max-width maintains aspect ratios on images. */ + max-width: 100%; } -body img.reader-image-tiny { - display: inline; - margin: 0; +#article img { + /* By default, images are centered on their own line. */ + margin: 0.5em auto; + display: block; + height: auto; } -body .leading-image, figure, .auxiliary { - margin-bottom: .25em; +#article img.reader-image-tiny { + display: inline; + margin: 0; } -body .leading-image img { - margin: auto; - display: block; - clear: both; +#article .leading-image, figure, .auxiliary { + margin-bottom: 1.15em; } -body .leading-image .credit { - margin: 0; - text-align: right; +#article .leading-image img { + margin: auto; + display: block; + clear: both; } -body .leading-image .caption, -body .leading-image .credit, -body figcaption, -body .auxiliary figcaption { - font-size: 0.75em; - line-height: 1.5em; - margin-top: 1em; - width: 100%; +#article .leading-image .credit { + margin: 0; } -body .leading-image .credit + .caption { - margin-top: 0.1em; +#article .leading-image, #article figure { + font-size: 0.75em; + line-height: 1.5em; } -body .auxiliary { - display: block; - clear: both; - font-size: 0.75em; - line-height: 1.4em; - text-align: start; +body.watch #article .leading-image, body.watch #article figure { + font-size: 0.8125rem; } -body .auxiliary > * { - -webkit-margin-start: 0; +#article .leading-image :matches(.caption, .credit), #article figcaption { + margin-top: 0.8em; + width: 100%; } -body .auxiliary img, body .auxiliary > *:first-child { - margin: 0; +#article figcaption>* { + margin-top: 0.25em; + margin-bottom: 0.25em; } +#article :matches(.leading-image, figure) p { + margin-top: 0.4em; + margin-bottom: 0.4em; +} + +#article .leading-image .credit+.caption { + margin-top: 0.1em; +} + +#article .auxiliary { + display: block; + clear: both; + font-size: 0.75em; + line-height: 1.4em; + text-align: start; +} + +#article .pullquote { + font-size: 1.42em; + line-height: 1.38em; + font-weight: 300; + font-style: italic; +} + +#article .pullquote:not(.float) { + margin-top: 1em; + margin-bottom: 1em; + -webkit-margin-start: 1em; + max-width: calc(100% - 1em); +} + +#article .auxiliary>*:not(img) { + -webkit-margin-start: 0; +} + +#article .auxiliary.float img, #article .auxiliary>*:first-child:not(img) { + margin: 0; +} + + +article { + text-align: start; + word-wrap: break-word; + hyphens: auto; +} + +article.rtl { + direction: rtl; +} + + /* If the element immediately after an image is inline, it might bump up against the image. */ -body .auxiliary img + * { - display: block; + +#article .auxiliary img+* { + display: block; +} + +#article .auxiliary figcaption { + font-size: 100%; +} + +#article .auxiliary * { + margin-top: 0.5em; + margin-bottom: 0.5em; +} + +body:not(.watch) #article .float.left { + float: left; + margin-right: 20px; } -body .auxiliary figcaption { - font-size: 100%; +body:not(.watch) #article .float.right { + float: right; + margin-left: 20px; } -body .auxiliary * { - margin-top: 0.5em; - margin-bottom: 0.5em; +body.watch #article .float { + width: auto !important; } -body .float.left { - float: left; - margin-right: 20px; +#article .clear { + clear: both; } -body .float.right { - float: right; - margin-left: 20px; +#article ul.list-style-type-none, #article ol.list-style-type-none, #article .list-style-type-none>li { + list-style-type: none; + -webkit-padding-start: 0; } -body .clear { - clear: both; +#article .list-style-type-none.code-block code { + white-space: pre-wrap; } -body ul.list-style-type-none, -body ol.list-style-type-none, -body .list-style-type-none > li { - list-style-type: none; - -webkit-padding-start: 0; +#article div.scrollable { + overflow-x: scroll; + word-wrap: normal; +} + +#article div.scrollable table { + max-width: none; +} + +#article .leading-image, #article figure, #article .auxiliary:not(.pullquote) { + font-family: Arial, Helvetica, sans-serif; +} + +#article .leading-image, #article figure, #article .auxiliary, #article .pullquote { + color: rgba(0, 0, 0, 0.65); +} + +figure { + margin: 0; +} + +body:not(.watch) figure:not(.float) { + margin-top: 1.4em; + margin-bottom: 1.4em; +} + +hr { + position: relative; + display: block; + width: 100%; + margin: 2.5em 0 3.5em; + padding: 0; + background: rgba(0, 0, 0, 0.2); + height: 1px; + border: 0; +} + +pre { + font-family: "Lucida Console", Courier, monospace; + font-size: 0.87em; + line-height: 1.45em; +} + +blockquote, q { + color: rgba(0, 0, 0, 0.65); +} + +blockquote:not(.pullquote) { + margin-left: 2px; + margin-right: 6px; + padding-left: 16px; +} + +blockquote:not(.simple):not(.pullquote) { + border-left: 3px solid rgba(0, 0, 0, 0.1); +} + +q.pullquote { + display: block; +} + +.pullquote q::before, .pullquote q::after, q.pullquote::before, q.pullquote::after { + content: ""; } /* Collapse excess whitespace. */ -.page p > p:empty, -.page div > p:empty, -.page p > div:empty, -.page div > div:empty, -.page p + br, -.page p > br:only-child, -.page div > br:only-child, -.page img + br -{ - display: none; + +article p>p:empty, article div>p:empty, article p>div:empty, article div>div:empty, article p+br, article img+br { + display: none; +} + +article table { + font-size: 0.9em; + text-align: start; + word-wrap: break-word; + border-collapse: collapse; +} + +article table td, article table th { + padding: 0.25em 0.5em; + border: 1px solid rgb(216, 216, 216); +} + +.delimiter { + margin-left: 0.45em; + margin-right: 0.45em; + margin-top: 0.07em; + padding: 0; +} + +.metadata.singleline .delimiter::after { + content: "•"; } -.title { - display: none; +.metadata:not(.singleline) .delimiter { + content: ""; + display: block !important; } -.page:first-of-type .title { - display: block; +article table th { + background-color: rgba(0, 0, 0, 0.025); } -.page table { - font-size: 0.9em; - text-align: start; - word-wrap: break-word; - border-collapse: collapse; +article sup, article sub { + line-height: 1; + font-size: 0.75em; } -.page table td, .page table th { - padding: 0.25em 0.5em; - border: 1px solid rgba(0, 0, 0, 0.1); +.hidden { + display: none; } -.page table th { - background-color: rgba(0, 0, 0, 0.025); +@media screen { + body { + margin: 0; + padding: 0; + -webkit-user-select: none; + overflow-x: hidden; + -webkit-text-size-adjust: none; + } + body.mac { + background-color: transparent; + } + #article { + pointer-events: auto; + -webkit-user-select: auto; + overflow: visible; + } + #article:focus { + outline: none; + } + #article { + margin-left: auto; + margin-right: auto; + padding-top: 35px; + padding-bottom: 35px; + position: relative; + border-top: 1px solid rgba(0, 0, 0, 0.2); + } + body article { + padding: 0 4px; + } + #article { + margin-top: 0; + border-top: none; + padding-top: 32px; + } + #article:last-of-type { + padding-bottom: 45px; + } + article video { + height: auto; + position: relative; + } +} + +#article .extendsBeyondTextColumn { + max-width: none; +} + +.iframe-wrapper { + background-color: black; + max-width: none; + text-align: center; } -.page a { - text-decoration: none; +iframe { + border: 0; +} + +@media only screen and (min-width: 780px) { + #article { + max-width: 800px; + margin: 0 auto; + } + /* Readable margins. */ + /* body #article { + max-width: 83.2ex; + } */ +} + +/* Use slightly smaller page padding when vertically constrained. */ + +@media screen and (max-height: 700px) { + #article { + padding-top: 32px; + padding-bottom: 32px; + } } diff --git a/components/speedreader/rust/.gitignore b/components/speedreader/rust/.gitignore new file mode 100644 index 000000000000..75eae4f5b777 --- /dev/null +++ b/components/speedreader/rust/.gitignore @@ -0,0 +1,8 @@ +# Generated by Cargo +# will have compiled files and executables +target/ + +# These are backup files generated by rustfmt +**/*.rs.bk + +data/ diff --git a/components/speedreader/rust/ffi/BUILD.gn b/components/speedreader/rust/ffi/BUILD.gn new file mode 100644 index 000000000000..1335ad56bccd --- /dev/null +++ b/components/speedreader/rust/ffi/BUILD.gn @@ -0,0 +1,110 @@ +# Copyright 2020 The Brave Authors. All rights reserved. +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this file, +# You can obtain one at http://mozilla.org/MPL/2.0/. */ + +import("//brave/build/cargo.gni") +import("//brave/build/rust/config.gni") +import("//brave/test/testing.gni") + +config("external_config") { + include_dirs = [ "src" ] +} + +# Cargo build for the Rust project +cargo_build("speedreader_rust_lib") { + inputs = [ + # Underlying library code + "../lib/build.rs", + "../lib/Cargo.lock", + "../lib/Cargo.toml", + "../lib/src/classifier/feature_extractor.rs", + "../lib/src/classifier/mod.rs", + "../lib/src/classifier/model.c", + "../lib/src/classifier/model.rs", + "../lib/src/classifier/model.rs", + "../lib/src/lib.rs", + "../lib/src/readability/Cargo.toml", + "../lib/src/readability/src/dom.rs", + "../lib/src/readability/src/error.rs", + "../lib/src/readability/src/extractor.rs", + "../lib/src/readability/src/lib.rs", + "../lib/src/readability/src/scorer.rs", + "../lib/src/rewriter_config_builder.rs", + "../lib/src/speedreader_heuristics.rs", + "../lib/src/speedreader_streaming.rs", + "../lib/src/speedreader.rs", + "../lib/src/whitelist.rs", + # FFI + "Cargo.lock", + "Cargo.toml", + "charbuf.rs", + "lib.rs", + "speedreader.rs", + ] + + if (rust_shared_lib && !is_component_build) { + lib_install_name = "@loader_path/../../Libraries/libspeedreader_ffi${cargo_lib_suffix}" + rust_flags += " -C link-args=-Wl,-install_name,$lib_install_name " + } + output = "${root_gen_dir}/speedreader/out/${cargo_lib_prefix}speedreader_ffi${cargo_lib_suffix}" + manifest_path = "Cargo.toml" + build_path = "${root_gen_dir}/speedreader/out" +} + +# Generate FFI header from Rust source +cargo_cbindgen("speedreader_ffi_header") { + config = "cbindgen.toml" + output = "${target_gen_dir}/speedreader_ffi.h" + + sources = [ + "Cargo.lock", + "Cargo.toml", + "cbindgen.toml", + "charbuf.rs", + "lib.rs", + "speedreader.rs", + ] +} + +# Build the FFI wrapper as a static library +source_set("speedreader_ffi") { + public_configs = [ ":external_config" ] + + sources = [ + "speedreader.cc", + "speedreader.h" + ] + + deps = [ + "//base", + ":speedreader_rust_lib", + ":speedreader_ffi_header", + ] + + libs = get_target_outputs(":speedreader_rust_lib") +} + +if (is_mac) { + bundle_data("speedreader_ffi_lib") { + sources = get_target_outputs(":speedreader_rust_lib") + outputs = [ + "{{bundle_contents_dir}}/Libraries/{{source_file_part}}", + ] + public_deps = [ + ":speedreader_rust_lib", + ] + } +} else { + group("speedreader_ffi_lib") {} +} + +if (rust_shared_lib && !is_component_build) { + fix_testing_install_name("test_install_name_speedreader") { + current_path = "@loader_path/../../Libraries/libspeedreader_ffi${cargo_lib_suffix}" + lib_paths = get_target_outputs(":speedreader_rust_lib") + new_path = "@executable_path/" + rebase_path(lib_paths[0], root_build_dir) + } +} else { + group("test_install_name_speedreader") {} +} diff --git a/components/speedreader/rust/ffi/Cargo.lock b/components/speedreader/rust/ffi/Cargo.lock new file mode 100644 index 000000000000..9f839ba3843a --- /dev/null +++ b/components/speedreader/rust/ffi/Cargo.lock @@ -0,0 +1,1472 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adblock" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "addr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lifeguard 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "once_cell 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "psl 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "rmp-serde 0.13.7 (registry+https://github.com/rust-lang/crates.io-index)", + "seahash 3.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", + "twoway 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "addr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "error-chain 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", + "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "psl 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "rental 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "adler32" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "ahash" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "const-random 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "aho-corasick" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "autocfg" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "autocfg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "backtrace" +version = "0.3.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "backtrace-sys 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "backtrace-sys" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.52 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "base64" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "byteorder" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cc" +version = "1.0.52" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "const-random" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "const-random-macro 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "const-random-macro" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "core-foundation" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "core-foundation-sys" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "crc32fast" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cssparser" +version = "0.25.9" +source = "git+https://github.com/AndriusA/rust-cssparser?branch=glibc#ad2f4d3c89e247ec1693a581ecace199e46f30fa" +dependencies = [ + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser-macros 0.3.6 (git+https://github.com/AndriusA/rust-cssparser?branch=glibc)", + "dtoa-short 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libm 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "procedural-masquerade 0.1.6 (git+https://github.com/AndriusA/rust-cssparser?branch=glibc)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cssparser-macros" +version = "0.3.6" +source = "git+https://github.com/AndriusA/rust-cssparser?branch=glibc#ad2f4d3c89e247ec1693a581ecace199e46f30fa" +dependencies = [ + "phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "procedural-masquerade 0.1.6 (git+https://github.com/AndriusA/rust-cssparser?branch=glibc)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "dtoa" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "dtoa-short" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "either" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "encoding_rs" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "error-chain" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "backtrace 0.3.46 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "flate2" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", + "miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "new_debug_unreachable 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "getrandom" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", + "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hashbrown" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ahash 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "html5ever" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "markup5ever 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "idna" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "idna" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itertools" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itoa" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "lazycell" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.69" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libm" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "lifeguard" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "log" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "lol_html" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.25.9 (git+https://github.com/AndriusA/rust-cssparser?branch=glibc)", + "encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "selectors 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "markup5ever" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "phf 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_codegen 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.51 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache_codegen 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tendril 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "markup5ever_rcdom" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "html5ever 0.25.1 (registry+https://github.com/rust-lang/crates.io-index)", + "markup5ever 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tendril 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "xml5ever 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "matches" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "memchr" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "miniz_oxide" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "native-tls" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.10.29 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.55 (registry+https://github.com/rust-lang/crates.io-index)", + "schannel 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework-sys 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "num-traits" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "once_cell" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "openssl" +version = "0.10.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.55 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "openssl-probe" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "openssl-sys" +version = "0.9.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.52 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "percent-encoding" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "phf" +version = "0.7.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_shared 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_codegen" +version = "0.7.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_generator 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_codegen" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_generator 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_shared 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_generator" +version = "0.7.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_generator" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_shared 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_shared" +version = "0.7.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_shared" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "siphasher 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pkg-config" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "ppv-lite86" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "proc-macro-hack" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "proc-macro2" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "proc-macro2" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "procedural-masquerade" +version = "0.1.6" +source = "git+https://github.com/AndriusA/rust-cssparser?branch=glibc#ad2f4d3c89e247ec1693a581ecace199e46f30fa" + +[[package]] +name = "psl" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "psl-codegen 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "psl-codegen" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "psl-lexer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "sequence_trie 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "psl-lexer" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "error-chain 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", + "native-tls 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quote" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quote" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_pcg 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_chacha" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_hc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_isaac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_jitter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_os" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_pcg" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_pcg" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_xorshift" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "readability" +version = "0.1.4" +dependencies = [ + "html5ever 0.25.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "markup5ever_rcdom 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "redox_syscall" +version = "0.1.56" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "regex" +version = "1.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aho-corasick 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.17 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex-syntax" +version = "0.6.17" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "remove_dir_all" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rental" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rental-impl 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rental-impl" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rmp" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rmp-serde" +version = "0.13.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rmp 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ryu" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "safemem" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "schannel" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "seahash" +version = "3.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "security-framework" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework-sys 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "security-framework-sys" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "selectors" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.25.9 (git+https://github.com/AndriusA/rust-cssparser?branch=glibc)", + "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "servo_arc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "thin-slice 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "sequence_trie" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "serde" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde_derive 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_derive" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_json" +version = "1.0.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "servo_arc" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "siphasher" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "siphasher" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "smallvec" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "speedreader" +version = "0.1.0" +dependencies = [ + "adblock 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.25.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lol_html 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "markup5ever 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "markup5ever_rcdom 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "readability 0.1.4", + "regex 1.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.51 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "speedreader-ffi" +version = "0.1.0" +dependencies = [ + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", + "speedreader 0.1.0", +] + +[[package]] +name = "stable_deref_trait" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "string_cache" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "new_debug_unreachable 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_shared 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "string_cache_codegen" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_generator 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_shared 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syn" +version = "0.14.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syn" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tempfile" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tendril" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futf 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "utf-8 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "thin-slice" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "thiserror" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "thiserror-impl 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "thread_local" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "time" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "twoway" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "unchecked-index 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unchecked-index" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-bidi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-normalization" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-xid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-xid" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "url" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "url" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "utf-8" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "vcpkg" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "version_check" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "xml5ever" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "markup5ever 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[metadata] +"checksum adblock 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f904dae28e043972a1acc1e1cdf303b6ab40a144387667d4ad29882cb93bd695" +"checksum addr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "22199dd03e5cff19ede8c2b835c93460f998b4716e225d06d740d925ceac5d75" +"checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" +"checksum ahash 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "6f33b5018f120946c1dcf279194f238a9f146725593ead1c08fa47ff22b0b5d3" +"checksum aho-corasick 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)" = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" +"checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" +"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +"checksum backtrace 0.3.46 (registry+https://github.com/rust-lang/crates.io-index)" = "b1e692897359247cc6bb902933361652380af0f1b7651ae5c5013407f30e109e" +"checksum backtrace-sys 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "78848718ee1255a2485d1309ad9cdecfc2e7d0362dd11c6829364c6b35ae1bc7" +"checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" +"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +"checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +"checksum cc 1.0.52 (registry+https://github.com/rust-lang/crates.io-index)" = "c3d87b23d6a92cd03af510a5ade527033f6aa6fa92161e2d5863a907d4c5e31d" +"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +"checksum const-random 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "2f1af9ac737b2dd2d577701e59fd09ba34822f6f2ebdb30a7647405d9e55e16a" +"checksum const-random-macro 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "25e4c606eb459dd29f7c57b2e0879f2b6f14ee130918c2b78ccb58a9624e6c7a" +"checksum core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" +"checksum core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" +"checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" +"checksum cssparser 0.25.9 (git+https://github.com/AndriusA/rust-cssparser?branch=glibc)" = "" +"checksum cssparser-macros 0.3.6 (git+https://github.com/AndriusA/rust-cssparser?branch=glibc)" = "" +"checksum dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" +"checksum dtoa-short 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "59020b8513b76630c49d918c33db9f4c91638e7d3404a28084083b87e33f76f2" +"checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" +"checksum encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)" = "cd8d03faa7fe0c1431609dfad7bbe827af30f82e1e2ae6f7ee4fca6bd764bc28" +"checksum error-chain 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d371106cc88ffdfb1eabd7111e432da544f16f3e2d7bf1dfe8bf575f1df045cd" +"checksum flate2 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)" = "2cfff41391129e0a856d6d822600b8d71179d46879e310417eb9c762eb178b42" +"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +"checksum futf 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7c9c1ce3fa9336301af935ab852c437817d14cd33690446569392e65170aac3b" +"checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +"checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +"checksum hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" +"checksum html5ever 0.25.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcf38a1a36118242d29b92e1b08ef84e67e4a5ed06e0a80be20e6a32bfed6b" +"checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" +"checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +"checksum itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" +"checksum itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" +"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +"checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" +"checksum libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)" = "99e85c08494b21a9054e7fe1374a732aeadaff3980b6990b94bfd3a70f690005" +"checksum libm 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" +"checksum lifeguard 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eee00513d51f9a08737b74a286c761fc641114d1d5d6329beb11510049ec405f" +"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +"checksum lol_html 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "169299b3b58aa5cd8ad25fd8fe984e93748046d24c80f05aaadd9022f95423ec" +"checksum mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" +"checksum markup5ever 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aae38d669396ca9b707bfc3db254bc382ddb94f57cc5c235f34623a669a01dab" +"checksum markup5ever_rcdom 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f015da43bcd8d4f144559a3423f4591d69b8ce0652c905374da7205df336ae2b" +"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +"checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +"checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +"checksum miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aa679ff6578b1cddee93d7e82e263b94a575e0bfced07284eb0c037c1d2416a5" +"checksum native-tls 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "2b0d88c06fe90d5ee94048ba40409ef1d9315d86f6f38c2efdaad4fb50c58b2d" +"checksum new_debug_unreachable 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +"checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" +"checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" +"checksum once_cell 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1c601810575c99596d4afc46f78a678c80105117c379eb3650cf99b8a21ce5b" +"checksum openssl 0.10.29 (registry+https://github.com/rust-lang/crates.io-index)" = "cee6d85f4cb4c4f59a6a85d5b68a233d280c82e29e822913b9c8b129fbf20bdd" +"checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" +"checksum openssl-sys 0.9.55 (registry+https://github.com/rust-lang/crates.io-index)" = "7717097d810a0f2e2323f9e5d11e71608355e24828410b55b9d4f18aa5f9a5d8" +"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" +"checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +"checksum phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b3da44b85f8e8dfaec21adae67f95d93244b2ecf6ad2a692320598dcc8e6dd18" +"checksum phf 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" +"checksum phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b03e85129e324ad4166b06b2c7491ae27fe3ec353af72e72cd1654c7225d517e" +"checksum phf_codegen 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" +"checksum phf_generator 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "09364cc93c159b8b06b1f4dd8a4398984503483891b0c26b867cf431fb132662" +"checksum phf_generator 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" +"checksum phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "234f71a15de2288bcb7e3b6515828d22af7ec8598ee6d24c3b526fa0a80b67a0" +"checksum phf_shared 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" +"checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" +"checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" +"checksum precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" +"checksum proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)" = "0d659fe7c6d27f25e9d80a1a094c223f5246f6a6596453e09d7229bf42750b63" +"checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +"checksum proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = "df246d292ff63439fea9bc8c0a270bed0e390d5ebd4db4ba15aba81111b5abe3" +"checksum procedural-masquerade 0.1.6 (git+https://github.com/AndriusA/rust-cssparser?branch=glibc)" = "" +"checksum psl 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0fcd4da9d98f254ad641dd081207cc14fcbec95dd58ee62ffc9b96f0684fd6c2" +"checksum psl-codegen 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "06f94f31e4f36b42e21b831d20bf0efc805b2155624697fb86f987b666518c3b" +"checksum psl-lexer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6cf84fe23023e855b9a9d038a1b08d5c438d3961d2ced6c2b2358b29fbf74a63" +"checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +"checksum quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" +"checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" +"checksum rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +"checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" +"checksum rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +"checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" +"checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +"checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" +"checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +"checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" +"checksum rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" +"checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" +"checksum rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" +"checksum rand_pcg 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" +"checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" +"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" +"checksum regex 1.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a6020f034922e3194c711b82a627453881bc4682166cabb07134a10c26ba7692" +"checksum regex-syntax 0.6.17 (registry+https://github.com/rust-lang/crates.io-index)" = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae" +"checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" +"checksum rental 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "8545debe98b2b139fb04cad8618b530e9b07c152d99a5de83c860b877d67847f" +"checksum rental-impl 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "475e68978dc5b743f2f40d8e0a8fdc83f1c5e78cbf4b8fa5e74e73beebc340de" +"checksum rmp 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)" = "0f10b46df14cf1ee1ac7baa4d2fbc2c52c0622a4b82fa8740e37bc452ac0184f" +"checksum rmp-serde 0.13.7 (registry+https://github.com/rust-lang/crates.io-index)" = "011e1d58446e9fa3af7cdc1fb91295b10621d3ac4cb3a85cc86385ee9ca50cd3" +"checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" +"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +"checksum ryu 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ed3d612bc64430efeb3f7ee6ef26d590dce0c43249217bddc62112540c7941e1" +"checksum safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" +"checksum schannel 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "039c25b130bd8c1321ee2d7de7fde2659fa9c2744e4bb29711cfc852ea53cd19" +"checksum seahash 3.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "58f57ca1d128a43733fd71d583e837b1f22239a37ebea09cde11d8d9a9080f47" +"checksum security-framework 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "572dfa3a0785509e7a44b5b4bebcf94d41ba34e9ed9eb9df722545c3b3c4144a" +"checksum security-framework-sys 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8ddb15a5fec93b7021b8a9e96009c5d8d51c15673569f7c0f6b7204e5b7b404f" +"checksum selectors 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1b86b100bede4f651059740afc3b6cb83458d7401cb7c1ad96d8a11e91742c86" +"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +"checksum sequence_trie 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1ee22067b7ccd072eeb64454b9c6e1b33b61cd0d49e895fd48676a184580e0c3" +"checksum serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)" = "36df6ac6412072f67cf767ebbde4133a5b2e88e76dc6187fa7104cd16f783399" +"checksum serde_derive 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)" = "9e549e3abf4fb8621bd1609f11dfc9f5e50320802273b12f3811a67e6716ea6c" +"checksum serde_json 1.0.51 (registry+https://github.com/rust-lang/crates.io-index)" = "da07b57ee2623368351e9a0488bb0b261322a15a6e0ae53e243cbdc0f4208da9" +"checksum servo_arc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d98238b800e0d1576d8b6e3de32827c2d74bee68bb97748dcf5071fb53965432" +"checksum siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" +"checksum siphasher 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8e88f89a550c01e4cd809f3df4f52dc9e939f3273a2017eabd5c6d12fd98bb23" +"checksum smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" +"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" +"checksum string_cache 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2940c75beb4e3bf3a494cef919a747a2cb81e52571e212bfbd185074add7208a" +"checksum string_cache_codegen 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f24c8e5e19d22a726626f1a5e16fe15b132dcf21d10177fa5a45ce7962996b97" +"checksum syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)" = "261ae9ecaa397c42b960649561949d69311f08eeaea86a65696e6e46517cf741" +"checksum syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "0df0eb663f387145cab623dea85b09c2c5b4b0aef44e945d928e682fce71bb03" +"checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +"checksum tendril 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "707feda9f2582d5d680d733e38755547a3e8fb471e7ba11452ecfd9ce93a5d3b" +"checksum thin-slice 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" +"checksum thiserror 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "54b3d3d2ff68104100ab257bb6bb0cb26c901abe4bd4ba15961f3bf867924012" +"checksum thiserror-impl 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "ca972988113b7715266f91250ddb98070d033c62a011fa0fcc57434a649310dd" +"checksum thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +"checksum time 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +"checksum twoway 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6b40075910de3a912adbd80b5d8bad6ad10a23eeb1f5bf9d4006839e899ba5bc" +"checksum unchecked-index 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c" +"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +"checksum unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "141339a08b982d942be2ca06ff8b076563cbe223d1befd5450716790d44e2426" +"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" +"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +"checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" +"checksum url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" +"checksum utf-8 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "05e42f7c18b8f902290b009cde6d651262f956c98bc51bca4cd1d511c9cd85c7" +"checksum vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" +"checksum version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" +"checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +"checksum xml5ever 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b1b52e6e8614d4a58b8e70cf51ec0cc21b256ad8206708bcff8139b5bbd6a59" diff --git a/components/speedreader/rust/ffi/Cargo.toml b/components/speedreader/rust/ffi/Cargo.toml new file mode 100644 index 000000000000..6e3f381f7d4e --- /dev/null +++ b/components/speedreader/rust/ffi/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "speedreader-ffi" +version = "0.1.0" +authors = ["Andrius Aucinas "] +edition = "2018" + +[dependencies] +speedreader = { path = "../lib/" } +libc = "0.2.7" +[patch.crates-io] +cssparser = { git = 'https://github.com/AndriusA/rust-cssparser', branch = "glibc" } + +[profile.release] +panic = "abort" + +[lib] +name = "speedreader_ffi" +path = "lib.rs" +crate-type = ["staticlib", "cdylib"] diff --git a/components/speedreader/rust/ffi/cbindgen.toml b/components/speedreader/rust/ffi/cbindgen.toml new file mode 100644 index 000000000000..bdea856fff51 --- /dev/null +++ b/components/speedreader/rust/ffi/cbindgen.toml @@ -0,0 +1,44 @@ +# The language to output bindings in +language = "C++" + +# Options for Wrapping the Contents of the Header +header = ''' +/* Copyright (c) 2020 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */''' +include_guard = "BRAVE_COMPONENTS_SPEEDREADER_RUST_FFI_SPEEDREADER_FFI_H_" +namespace = "speedreader" + +no_includes = true +sys_includes = ["cstddef", "cstdint", "string"] + +# Code Stylr Options +braces = "SameLine" +line_length = 80 +tab_width = 2 +documentation_style = "auto" +autogen_warning = "// Warning, this file is autogenerated by cbindgen. Don't modify manually." + +[fn] +args = "Vertical" + +[parse] +# Whether to parse dependent crates and include their types in the generated +# bindings +parse_deps = true +include = ["speedreader"] + +[parse.expand] +# A list of crate names that should be run through `cargo expand` before +# parsing to expand any macros +crates = [] +all_features = false +default_features = false +features = ["cbindgen"] + +[export] +# A prefix to add before the name of every item +prefix = "C_" + +[defines] diff --git a/components/speedreader/rust/ffi/charbuf.rs b/components/speedreader/rust/ffi/charbuf.rs new file mode 100644 index 000000000000..816e9872b18e --- /dev/null +++ b/components/speedreader/rust/ffi/charbuf.rs @@ -0,0 +1,39 @@ +use super::*; + +// NOTE: we don't use CStr and CString as the transfer type because UTF8 +// strings comming from both sides can contain interior NULLs. +#[repr(C)] +pub struct CharBuf { + data: *const c_char, + len: size_t, +} + +impl CharBuf { + pub fn new(string: String) -> Self { + CharBuf { + len: string.len(), + data: Box::into_raw(string.into_boxed_str()) as *const c_char, + } + } + + #[inline] + pub fn opt_ptr(string: Option) -> *const Self { + match string { + Some(string) => to_ptr(Self::new(string)), + None => ptr::null(), + } + } +} + +impl Drop for CharBuf { + fn drop(&mut self) { + let bytes = unsafe { slice::from_raw_parts_mut(self.data as *mut c_char, self.len) }; + + drop(unsafe { Box::from_raw(bytes) }); + } +} + +#[no_mangle] +pub extern "C" fn speedreader_str_free(string: CharBuf) { + drop(string); +} diff --git a/components/speedreader/rust/ffi/lib.rs b/components/speedreader/rust/ffi/lib.rs new file mode 100644 index 000000000000..6a455832af55 --- /dev/null +++ b/components/speedreader/rust/ffi/lib.rs @@ -0,0 +1,98 @@ +use ::speedreader::*; +use libc::{c_char, c_int, size_t}; +use std::cell::RefCell; +use std::{ptr, slice, str}; + +#[inline] +fn to_ptr(val: T) -> *const T { + Box::into_raw(Box::new(val)) +} + +#[inline] +fn to_ptr_mut(val: T) -> *mut T { + Box::into_raw(Box::new(val)) +} + +// NOTE: abort the thread if we receive NULL where unexpected +macro_rules! assert_not_null { + ($var:ident) => { + assert!(!$var.is_null(), "{} is NULL", stringify!($var)); + }; +} + +// NOTE: all these utilities are macros so we can propagate the variable +// name to the null pointer assertion. +macro_rules! to_ref { + ($ptr:ident) => {{ + assert_not_null!($ptr); + unsafe { &*$ptr } + }}; +} + +macro_rules! void_to_box { + ($ptr:ident) => {{ + assert_not_null!($ptr); + unsafe { Box::from_raw($ptr as *mut _) } + }}; +} + +macro_rules! leak_void_to_box { + ($ptr:ident) => {{ + assert_not_null!($ptr); + Box::leak(unsafe { Box::from_raw($ptr as *mut _) }) + }}; +} + +macro_rules! box_to_opaque { + ($ptr:ident, $opaque:ident) => {{ + to_ptr_mut($ptr) as *mut $opaque + }}; +} + +macro_rules! to_box { + ($ptr:ident) => {{ + assert_not_null!($ptr); + unsafe { Box::from_raw($ptr) } + }}; +} + +macro_rules! to_bytes { + ($data:ident, $len:ident) => {{ + assert_not_null!($data); + unsafe { slice::from_raw_parts($data as *const u8, $len) } + }}; +} + +macro_rules! to_str { + ($data:ident, $len:ident) => { + str::from_utf8(to_bytes!($data, $len)).into() + }; +} + +macro_rules! unwrap_or_ret { + ($expr:expr, $ret_val:expr) => { + match $expr { + Ok(v) => v, + Err(_err) => { + return $ret_val; + } + } + }; +} + +macro_rules! unwrap_or_ret_err_code { + ($expr:expr) => { + unwrap_or_ret!($expr, -1) + }; +} + +macro_rules! unwrap_or_ret_null { + ($expr:expr) => { + unwrap_or_ret!($expr, ptr::null_mut()) + }; +} + +mod speedreader; +mod charbuf; + +pub use self::charbuf::CharBuf; diff --git a/components/speedreader/rust/ffi/speedreader.cc b/components/speedreader/rust/ffi/speedreader.cc new file mode 100644 index 000000000000..056bc484dd08 --- /dev/null +++ b/components/speedreader/rust/ffi/speedreader.cc @@ -0,0 +1,127 @@ +/* Copyright (c) 2020 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "brave/components/speedreader/rust/ffi/speedreader.h" + +#include + +#include "base/logging.h" +#include "brave/components/speedreader/rust/ffi/speedreader_ffi.h" + +namespace speedreader { + +SpeedReader::SpeedReader() : raw(speedreader_new()) {} +SpeedReader::SpeedReader(const char* whitelist_serialized, + size_t whitelist_size) + : raw(with_whitelist(whitelist_serialized, whitelist_size)) {} + +bool SpeedReader::deserialize(const char* data, size_t data_size) { + auto* new_raw = with_whitelist(data, data_size); + if (new_raw != nullptr) { + speedreader_free(raw); + raw = new_raw; + return true; + } else { + VLOG(2) << __func__ << " deserialization failed"; + return false; + } +} + +SpeedReader::~SpeedReader() { + speedreader_free(raw); +} + +bool SpeedReader::IsReadableURL(const std::string& url) { + return url_readable(raw, url.c_str(), url.length()); +} + +RewriterType SpeedReader::RewriterTypeForURL(const std::string& url) { + return find_type(raw, url.c_str(), url.length()); +} + +std::unique_ptr SpeedReader::MakeRewriter(const std::string& url) { + return std::make_unique(raw, url, RewriterType::RewriterUnknown); +} + +std::unique_ptr SpeedReader::MakeRewriter( + const std::string& url, + RewriterType rewriter_type) { + return std::make_unique(raw, url, rewriter_type); +} + +std::unique_ptr SpeedReader::MakeRewriter( + const std::string& url, + RewriterType rewriter_type, + void (*output_sink)(const char*, size_t, void*), + void* output_sink_user_data) { + return std::make_unique(raw, url, rewriter_type, output_sink, + output_sink_user_data); +} + +Rewriter::Rewriter(C_SpeedReader* speedreader, + const std::string& url, + RewriterType rewriter_type) + : Rewriter( + speedreader, + url, + rewriter_type, + [](const char* chunk, size_t chunk_len, void* user_data) { + std::string* out = static_cast(user_data); + out->append(chunk, chunk_len); + }, + &output_) {} + +Rewriter::Rewriter(C_SpeedReader* speedreader, + const std::string& url, + RewriterType rewriter_type, + void (*output_sink)(const char*, size_t, void*), + void* output_sink_user_data) + : output_(""), + ended_(false), + poisoned_(false), + config_raw( + get_rewriter_opaque_config(speedreader, url.c_str(), url.length())), + raw(rewriter_new(speedreader, + url.c_str(), + url.length(), + output_sink, + output_sink_user_data, + config_raw, + rewriter_type)) {} + +Rewriter::~Rewriter() { + if (!ended_) { + rewriter_free(raw); + } + free_rewriter_opaque_config(config_raw); +} + +int Rewriter::Write(const char* chunk, size_t chunk_len) { + if (!ended_ && !poisoned_) { + int ret = rewriter_write(raw, chunk, chunk_len); + if (ret != 0) { + poisoned_ = true; + } + return ret; + } else { + return -1; + } +} + +int Rewriter::End() { + if (!ended_ && !poisoned_) { + int ret = rewriter_end(raw); + ended_ = true; + return ret; + } else { + return -1; + } +} + +const std::string& Rewriter::GetOutput() { + return output_; +} + +} // namespace speedreader diff --git a/components/speedreader/rust/ffi/speedreader.h b/components/speedreader/rust/ffi/speedreader.h new file mode 100644 index 000000000000..cca7b6dbe02a --- /dev/null +++ b/components/speedreader/rust/ffi/speedreader.h @@ -0,0 +1,105 @@ +/* Copyright (c) 2020 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef BRAVE_COMPONENTS_SPEEDREADER_RUST_FFI_SPEEDREADER_H_ +#define BRAVE_COMPONENTS_SPEEDREADER_RUST_FFI_SPEEDREADER_H_ + +#include +#include + +#include "brave/components/speedreader/rust/ffi/speedreader_ffi.h" + +namespace speedreader { + +using RewriterType = C_CRewriterType; + +class Rewriter { + public: + /// Create a buffering `Rewriter`. Output will be accumulated internally, + /// retrievable via `GetOutput`. Expected to only be instantiated by + /// `SpeedReader`. + Rewriter(C_SpeedReader* speedreader, + const std::string& url, + RewriterType rewriter_type); + + /// Create a streaming `Rewriter`. Provided callback will be called with every + /// new chunk of output available. Output availability is not strictly related + /// to when more input is `Written`. Expected to only be instantiated by + /// `SpeedReader`. + Rewriter(C_SpeedReader* speedreader, + const std::string& url, + RewriterType rewriter_type, + void (*output_sink)(const char*, size_t, void*), + void* output_sink_user_data); + ~Rewriter(); + + Rewriter(const Rewriter&) = delete; + void operator=(const Rewriter&) = delete; + + /// Write a new chunk of data (byte array) to the rewriter instance. Does + /// _not_ need to be a full document and can be called many times with ever + /// new chunk of data available. + int Write(const char* chunk, size_t chunk_len); + + /// Finish processing input and "close" the `Rewriter`. Flushes any input not + /// yet processed and deallocates some of the internal resources. + int End(); + + /// Returns accumulated output. Output is only accumulated if no explicit + /// callback was provided, otherwise will return an empty string. + const std::string& GetOutput(); + + private: + std::string output_; + bool ended_; + bool poisoned_; + C_CRewriterConfig* config_raw; + C_CRewriter* raw; +}; + +class SpeedReader { + public: + SpeedReader(); + /// New instance of SpeedReader using serialized whitelist + SpeedReader(const char* whitelist_serialized, size_t whitelist_size); + ~SpeedReader(); + SpeedReader(const SpeedReader&) = delete; + void operator=(const SpeedReader&) = delete; + + bool deserialize(const char* data, size_t data_size); + + /// Checks if the provided URL matches whitelisted readable URLs. + bool IsReadableURL(const std::string& url); + + /// Returns type of SpeedReader that would be applied by default for the given + /// URL. `RewriterUnknown` if no match in the whitelist. + RewriterType RewriterTypeForURL(const std::string& url); + + /// Create a buffering `Rewriter`. Output will be accumulated by the + /// `Rewriter` instance. + std::unique_ptr MakeRewriter(const std::string& url); + + /// Create a buffering `Rewriter` wih a specific `RewriterType`. Output will + /// be accumulated by the `Rewriter` instance. Using `RewriterUnknown` for + /// `RewriterType` is equivalent to skipping the parameter. + std::unique_ptr MakeRewriter(const std::string& url, + RewriterType rewriter_type); + + /// Create a `Rewriter` that calls provided callback with every new chunk of + /// output available. + std::unique_ptr MakeRewriter(const std::string& url, + RewriterType rewriter_type, + void (*output_sink)(const char*, + size_t, + void*), + void* output_sink_user_data); + + private: + C_SpeedReader* raw; +}; + +} // namespace speedreader + +#endif // BRAVE_COMPONENTS_SPEEDREADER_RUST_FFI_SPEEDREADER_H_ diff --git a/components/speedreader/rust/ffi/speedreader.rs b/components/speedreader/rust/ffi/speedreader.rs new file mode 100644 index 000000000000..64f913ae2d97 --- /dev/null +++ b/components/speedreader/rust/ffi/speedreader.rs @@ -0,0 +1,229 @@ +use super::*; +use libc::c_void; +use std::panic::{self, AssertUnwindSafe}; +use std::any::Any; + +// NOTE: we use `ExternOutputSink` proxy type, for extern handler function +struct ExternOutputSink { + handler: unsafe extern "C" fn(*const c_char, size_t, *mut c_void), + user_data: *mut c_void, +} + +impl ExternOutputSink { + #[inline] + fn new( + handler: unsafe extern "C" fn(*const c_char, size_t, *mut c_void), + user_data: *mut c_void, + ) -> Self { + ExternOutputSink { handler, user_data } + } +} + +impl OutputSink for ExternOutputSink { + #[inline] + fn handle_chunk(&mut self, chunk: &[u8]) { + let chunk_len = chunk.len(); + let chunk = chunk.as_ptr() as *const c_char; + + unsafe { (self.handler)(chunk, chunk_len, self.user_data) }; + } +} + +/// Indicate type of rewriter that would be used based on existing +/// configuration. `RewrtierUnknown` indicates that no configuration was found +/// for the provided parameters. +/// Also used to ask for a specific type of rewriter if desired; passing +/// `RewriterUnknown` tells SpeedReader to look the type up by configuration +/// and use heuristics-based one if not found otherwise. +#[repr(C)] +pub enum CRewriterType { + RewriterStreaming, + RewriterHeuristics, + RewriterUnknown, +} + +impl CRewriterType { + fn to_rewriter_type(&self) -> Option { + match &self { + CRewriterType::RewriterStreaming => Some(RewriterType::Streaming), + CRewriterType::RewriterHeuristics => Some(RewriterType::Heuristics), + CRewriterType::RewriterUnknown => None, + } + } +} + +impl From for CRewriterType { + fn from(r_type: RewriterType) -> Self { + match r_type { + RewriterType::Streaming => CRewriterType::RewriterStreaming, + RewriterType::Heuristics => CRewriterType::RewriterHeuristics, + RewriterType::Unknown => CRewriterType::RewriterUnknown, + } + } +} + +/// Opaque structure to have the minimum amount of type safety across the FFI. +/// Only replaces c_void +#[repr(C)] +pub struct CRewriter { + _private: [u8; 0], +} + +/// Opaque structure to have the minimum amount of type safety across the FFI. +/// Only replaces c_void +#[repr(C)] +pub struct CRewriterConfig { + _private: [u8; 0], +} + +/// New instance of SpeedReader. Loads the default configuration and rewriting +/// whitelists. Must be freed by calling `speedreader_free`. +#[no_mangle] +pub extern "C" fn speedreader_new() -> *mut SpeedReader { + to_ptr_mut(SpeedReader::default()) +} + +/// New instance of SpeedReader using deserialized whitelist +#[no_mangle] +pub extern "C" fn with_whitelist( + whitelist_data: *const c_char, + whitelist_data_size: size_t, +) -> *mut SpeedReader { + let whitelist_data: &[u8] = + unsafe { std::slice::from_raw_parts(whitelist_data as *const u8, whitelist_data_size) }; + let whitelist = unwrap_or_ret_null! { whitelist::Whitelist::deserialize(whitelist_data) }; + to_ptr_mut(SpeedReader::with_whitelist(whitelist)) +} + +/// Checks if the provided URL matches whitelisted readable URLs. +#[no_mangle] +pub extern "C" fn url_readable( + speedreader: *const SpeedReader, + url: *const c_char, + url_len: size_t, +) -> bool { + let url = unwrap_or_ret! { to_str!(url, url_len), false }; + let speedreader = to_ref!(speedreader); + speedreader.url_readable(url).unwrap_or(false) +} + +/// Returns type of SpeedReader that would be applied by default for the given +/// URL. `RewriterUnknown` if no match in the whitelist. +#[no_mangle] +pub extern "C" fn find_type( + speedreader: *const SpeedReader, + url: *const c_char, + url_len: size_t, +) -> CRewriterType { + let url = unwrap_or_ret! { to_str!(url, url_len), CRewriterType::RewriterUnknown }; + let speedreader = to_ref!(speedreader); + let rewriter_type = speedreader.get_rewriter_type(url); + CRewriterType::from(rewriter_type) +} + +#[no_mangle] +pub extern "C" fn speedreader_free(speedreader: *mut SpeedReader) { + assert_not_null!(speedreader); + drop(to_box!(speedreader)); +} + +#[no_mangle] +pub extern "C" fn get_rewriter_opaque_config( + speedreader: *const SpeedReader, + url: *const c_char, + url_len: size_t +) -> *mut CRewriterConfig { + let url = unwrap_or_ret_null! { to_str!(url, url_len) }; + let speedreader = to_ref!(speedreader); + + let opaque_config = speedreader.get_opaque_config(url); + box_to_opaque!(opaque_config, CRewriterConfig) +} + +/// Returns SpeedReader rewriter instance for the given URL. If provided +/// `rewriter_type` is `RewriterUnknown`, will look it up in the whitelist +/// and default to heuristics-based rewriter if none found in the whitelist. +/// Returns NULL if no URL provided or initialization fails. +/// Results of rewriting sent to `output_sink` callback function. +/// MUST be finished with `rewriter_end` which will free +/// associated memory. +#[no_mangle] +pub extern "C" fn rewriter_new( + speedreader: *const SpeedReader, + url: *const c_char, + url_len: size_t, + output_sink: unsafe extern "C" fn(*const c_char, size_t, *mut c_void), + output_sink_user_data: *mut c_void, + rewriter_opaque_config: *mut CRewriterConfig, + rewriter_type: CRewriterType, +) -> *mut CRewriter { + let url = unwrap_or_ret_null! { to_str!(url, url_len) }; + let speedreader = to_ref!(speedreader); + + let opaque_config: &Box = leak_void_to_box!(rewriter_opaque_config); + + let output_sink = ExternOutputSink::new(output_sink, output_sink_user_data); + + let rewriter = unwrap_or_ret_null! { speedreader + .get_rewriter( + url, + opaque_config, + output_sink, + rewriter_type.to_rewriter_type(), + ) + }; + box_to_opaque!(rewriter, CRewriter) +} + +/// Write a new chunk of data (byte array) to the rewriter instance. +#[no_mangle] +pub extern "C" fn rewriter_write( + rewriter: *mut CRewriter, + chunk: *const c_char, + chunk_len: size_t, +) -> c_int { + let chunk = to_bytes!(chunk, chunk_len); + let rewriter: &mut Box = leak_void_to_box!(rewriter); + + let mut rewriter = AssertUnwindSafe(rewriter); + + let res = panic::catch_unwind(move || { + rewriter.write(chunk) + }); + + let res = match res { + Ok(v) => v, + Err(_err) => { + // crate::errors::LAST_ERROR.with(|cell| *cell.borrow_mut() = Some(err.into())); + return -1; + } + }; + unwrap_or_ret_err_code! { res }; + 0 +} + +/// Complete rewriting for this instance. +/// Will free memory used by the rewriter. +/// Calling twice will cause panic. +#[no_mangle] +pub extern "C" fn rewriter_end(rewriter: *mut CRewriter) -> c_int { + // Clean up the memory by converting the pointer back into a Box and letting + // the Box be dropped at the end of the function + let mut rewriter: Box> = void_to_box!(rewriter); + unwrap_or_ret_err_code! { rewriter.end() }; + 0 +} + +#[no_mangle] +pub extern "C" fn rewriter_free(rewriter: *mut CRewriter) { + // Clean up the memory by converting the pointer back + // into a Box and letting the Box be dropped. + void_to_box!(rewriter); +} + +#[no_mangle] +pub extern "C" fn free_rewriter_opaque_config(config: *mut CRewriterConfig) { + // Clean up the memory by converting the pointer back + // into a Box and letting the Box be dropped. + void_to_box!(config); +} diff --git a/components/speedreader/rust/ffi/speedreader_unittest.cc b/components/speedreader/rust/ffi/speedreader_unittest.cc new file mode 100644 index 000000000000..dd079bac69ae --- /dev/null +++ b/components/speedreader/rust/ffi/speedreader_unittest.cc @@ -0,0 +1,168 @@ +/* Copyright (c) 2020 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "brave/components/speedreader/rust/ffi/speedreader.h" + +#include +#include + +#include "base/files/file_path.h" +#include "base/files/file_util.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/googletest/src/googletest/include/gtest/gtest.h" + +namespace { + +constexpr char test_config[] = R"( +[ + { + "domain": "example.com", + "url_rules": [ + "||example.com/*/article/" + ], + "declarative_rewrite": { + "main_content": [ + ".article-title", + ".article-body" + ], + "main_content_cleanup": [ + ".hidden" + ], + "delazify": true, + "fix_embeds": false, + "content_script": null, + "preprocess": [] + } + }, + { + "domain": "anotherexample.com", + "url_rules": [ + "||anotherexample.com/article/" + ] + } +] +)"; + +} // namespace + +namespace speedreader { + +TEST(SpeedreaderFFITest, URLReadable) { + SpeedReader sr; + ASSERT_TRUE(sr.deserialize(test_config, strlen(test_config))); + std::string url_str = "https://example.com/news/article/topic/index.html"; + EXPECT_TRUE(sr.IsReadableURL(url_str)); +} + +TEST(SpeedreaderFFITest, URLNotReadable) { + SpeedReader sr; + ASSERT_TRUE(sr.deserialize(test_config, strlen(test_config))); + std::string url_str = "https://unknown.com/news/article/topic/index.html"; + EXPECT_FALSE(sr.IsReadableURL(url_str)); +} + +TEST(SpeedreaderFFITest, URLInvalid) { + SpeedReader sr; + std::string url_str = "brave://about"; + EXPECT_FALSE(sr.IsReadableURL(url_str)); +} + +TEST(SpeedreaderFFITest, URLEmpty) { + SpeedReader sr; + std::string url_str = ""; + EXPECT_FALSE(sr.IsReadableURL(url_str)); +} + +TEST(SpeedreaderFFITest, FindRewriterType) { + SpeedReader sr; + ASSERT_TRUE(sr.deserialize(test_config, strlen(test_config))); + std::string url_str = "https://example.com/news/article/topic/index.html"; + EXPECT_EQ(sr.RewriterTypeForURL(url_str), RewriterType::RewriterStreaming); +} + +TEST(SpeedreaderFFITest, HeuristicsRewriterType) { + SpeedReader sr; + ASSERT_TRUE(sr.deserialize(test_config, strlen(test_config))); + std::string url_str = + "https://anotherexample.com/news/article/topic/index.html"; + EXPECT_EQ(sr.RewriterTypeForURL(url_str), RewriterType::RewriterHeuristics); +} + +TEST(SpeedreaderFFITest, UnknownRewriterType) { + SpeedReader sr; + ASSERT_TRUE(sr.deserialize(test_config, strlen(test_config))); + std::string url_str = "https://unknown.com/news/article/topic/index.html"; + EXPECT_EQ(sr.RewriterTypeForURL(url_str), RewriterType::RewriterUnknown); +} + +TEST(SpeedreaderFFITest, RewriterCallback) { + SpeedReader sr; + ASSERT_TRUE(sr.deserialize(test_config, strlen(test_config))); + std::string url_str = "https://example.com/news/article/topic/index.html"; + std::string output; + auto callback = [](const char* chunk, size_t chunk_len, void* user_data) { + std::string* out = static_cast(user_data); + out->append(chunk, chunk_len); + }; + auto rewriter = sr.MakeRewriter(url_str, RewriterType::RewriterUnknown, + callback, &output); + const char* content1 = "
"; + ASSERT_EQ(rewriter->Write(content1, strlen(content1)), 0); + const char* content2 = "hello world
"; + ASSERT_EQ(rewriter->Write(content2, strlen(content2)), 0); + ASSERT_EQ(rewriter->End(), 0); + EXPECT_STREQ(output.c_str(), + "
hello world
"); + EXPECT_STREQ(rewriter->GetOutput().c_str(), ""); +} + +TEST(SpeedreaderFFITest, RewriterBufering) { + SpeedReader sr; + ASSERT_TRUE(sr.deserialize(test_config, strlen(test_config))); + std::string url_str = "https://example.com/news/article/topic/index.html"; + auto rewriter = sr.MakeRewriter(url_str); + const char* content1 = "
"; + ASSERT_EQ(rewriter->Write(content1, strlen(content1)), 0); + const char* content2 = "hello world
"; + ASSERT_EQ(rewriter->Write(content2, strlen(content2)), 0); + ASSERT_EQ(rewriter->End(), 0); + EXPECT_STREQ(rewriter->GetOutput().c_str(), + "
hello world
"); +} + +TEST(SpeedreaderFFITest, RewriterBadSequence) { + SpeedReader sr; + ASSERT_TRUE(sr.deserialize(test_config, strlen(test_config))); + std::string url_str = "https://example.com/news/article/topic/index.html"; + auto rewriter = sr.MakeRewriter(url_str, RewriterType::RewriterUnknown); + ASSERT_EQ(rewriter->End(), 0); + const char* content = "hello"; + ASSERT_NE(rewriter->Write(content, strlen(content)), 0); +} + +TEST(SpeedreaderFFITest, RewriterDoubleEnd) { + SpeedReader sr; + ASSERT_TRUE(sr.deserialize(test_config, strlen(test_config))); + std::string url_str = "https://example.com/news/article/topic/index.html"; + auto rewriter = sr.MakeRewriter(url_str, RewriterType::RewriterUnknown); + ASSERT_EQ(rewriter->End(), 0); + ASSERT_NE(rewriter->End(), 0); +} + +TEST(SpeedreaderFFITest, RewriterParsingAmbiguity) { + const char* ambiguity = + ""; + SpeedReader sr; + ASSERT_TRUE(sr.deserialize(test_config, strlen(test_config))); + std::string url_str = "https://example.com/news/article/topic/index.html"; + auto rewriter = sr.MakeRewriter(url_str, RewriterType::RewriterUnknown); + int write_ret = rewriter->Write(ambiguity, strlen(ambiguity)); + if (write_ret == 0) { + int end_ret = rewriter->End(); + EXPECT_NE(end_ret, 0); + } +} + +} // namespace speedreader diff --git a/components/speedreader/rust/lib/Cargo.lock b/components/speedreader/rust/lib/Cargo.lock new file mode 100644 index 000000000000..0a72e4d4af24 --- /dev/null +++ b/components/speedreader/rust/lib/Cargo.lock @@ -0,0 +1,2457 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adblock" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "addr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lifeguard 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "once_cell 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "psl 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rmp-serde 0.13.7 (registry+https://github.com/rust-lang/crates.io-index)", + "seahash 3.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "twoway 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "addr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "error-chain 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", + "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "psl 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rental 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "adler32" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "ahash" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "const-random 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "aho-corasick" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "arc-swap" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hermit-abi 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "autocfg" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "autocfg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "backtrace" +version = "0.3.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "backtrace-sys 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "backtrace-sys" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "base64" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "base64" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bstr" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-automata 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bumpalo" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "byteorder" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bytes" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "c2-chacha" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cast" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cc" +version = "1.0.50" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "clap" +version = "2.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "const-random" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "const-random-macro 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "const-random-macro" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "core-foundation" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "core-foundation-sys" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "crc32fast" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "criterion" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", + "criterion-plot 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "csv 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "oorandom 11.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "plotters 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", + "tinytemplate 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "criterion-plot" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-deque" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-queue" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-utils" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cssparser" +version = "0.25.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser-macros 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "dtoa-short 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "procedural-masquerade 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cssparser-macros" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "procedural-masquerade 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "csv" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bstr 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "csv-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "csv-core" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "distance" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "dtoa" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "dtoa-short" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "either" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "encoding_rs" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "error-chain" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "backtrace 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "flate2" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fnv" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "new_debug_unreachable 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "futures" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-executor 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "futures-channel" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "futures-core" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-executor" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "futures-io" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-macro" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "futures-sink" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-task" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-util" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-macro 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "getrandom" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "h2" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hashbrown" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ahash 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hermit-abi" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "html5ever" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "markup5ever 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "http" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "http-body" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "httparse" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "hyper" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "h2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hyper-tls" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", + "native-tls 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tls 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "idna" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "idna" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "indexmap" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itertools" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itoa" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "js-sys" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "lazycell" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.67" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "lifeguard" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "log" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "lol_html" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.25.9 (registry+https://github.com/rust-lang/crates.io-index)", + "encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "selectors 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "markup5ever" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "phf 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_codegen 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache_codegen 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tendril 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "markup5ever_rcdom" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "html5ever 0.25.1 (registry+https://github.com/rust-lang/crates.io-index)", + "markup5ever 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tendril 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "xml5ever 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "matches" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "memchr" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "memoffset" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "mime_guess" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", + "unicase 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "miniz_oxide" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mio" +version = "0.6.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mio-named-pipes" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", + "miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mio-uds" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "miow" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "miow" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "socket2 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "native-tls" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.10.28 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)", + "schannel 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework-sys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "net2" +version = "0.2.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "num-traits" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num_cpus" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hermit-abi 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "numtoa" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "once_cell" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "oorandom" +version = "11.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "openssl" +version = "0.10.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "openssl-probe" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "openssl-sys" +version = "0.9.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "percent-encoding" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "phf" +version = "0.7.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_shared 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_codegen" +version = "0.7.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_generator 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_codegen" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_generator 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_shared 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_generator" +version = "0.7.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_generator" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_shared 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_shared" +version = "0.7.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_shared" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "siphasher 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pin-project" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "pin-project-internal 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pin-project-internal" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pin-project-lite" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "pin-utils" +version = "0.1.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "pkg-config" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "plotters" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "proc-macro-hack" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "proc-macro-nested" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "proc-macro2" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "proc-macro2" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "procedural-masquerade" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "psl" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "psl-codegen 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "psl-codegen" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "psl-lexer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "sequence_trie 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "psl-lexer" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "error-chain 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", + "native-tls 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quote" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quote" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_pcg 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_chacha" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_chacha" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_hc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_isaac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_jitter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_os" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_pcg" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_pcg" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_xorshift" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rayon" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rayon-core" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "readability" +version = "0.1.4" +dependencies = [ + "html5ever 0.25.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "markup5ever_rcdom 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "redox_syscall" +version = "0.1.56" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "redox_termios" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aho-corasick 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex-automata" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex-syntax" +version = "0.6.16" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "remove_dir_all" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rental" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rental-impl 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rental-impl" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "reqwest" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper-tls 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", + "mime_guess 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "native-tls 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tls 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-futures 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rmp" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rmp-serde" +version = "0.13.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rmp 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ryu" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "safemem" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "schannel" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "seahash" +version = "3.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "security-framework" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework-sys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "security-framework-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "selectors" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cssparser 0.25.9 (registry+https://github.com/rust-lang/crates.io-index)", + "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "servo_arc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "thin-slice 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "sequence_trie" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "serde" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_derive" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_json" +version = "1.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_urlencoded" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "servo_arc" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "signal-hook-registry" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arc-swap 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "siphasher" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "siphasher" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "slab" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "smallvec" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "socket2" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "speedreader" +version = "0.1.0" +dependencies = [ + "adblock 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "criterion 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "distance 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.25.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lol_html 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "markup5ever 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "markup5ever_rcdom 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "readability 0.1.4", + "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "reqwest 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "termion 1.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "stable_deref_trait" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "string_cache" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "new_debug_unreachable 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_shared 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "string_cache_codegen" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_generator 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_shared 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syn" +version = "0.14.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syn" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tempfile" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tendril" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futf 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "utf-8 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "termion" +version = "1.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "thin-slice" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "thiserror" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "thiserror-impl 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "thread_local" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "time" +version = "0.1.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tinytemplate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", + "mio-named-pipes 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "signal-hook-registry 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-macros 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-macros" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-tls" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "native-tls 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-util" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tower-service" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "try-lock" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "twoway" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "unchecked-index 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unchecked-index" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-normalization" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-width" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-xid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-xid" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "url" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "url" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "utf-8" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "vcpkg" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "version_check" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "walkdir" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "wasm-bindgen" +version = "0.2.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bumpalo 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro-support 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-backend 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.59" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "web-sys" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winreg" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "xml5ever" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "markup5ever 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[metadata] +"checksum adblock 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f904dae28e043972a1acc1e1cdf303b6ab40a144387667d4ad29882cb93bd695" +"checksum addr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "22199dd03e5cff19ede8c2b835c93460f998b4716e225d06d740d925ceac5d75" +"checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" +"checksum ahash 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "6f33b5018f120946c1dcf279194f238a9f146725593ead1c08fa47ff22b0b5d3" +"checksum aho-corasick 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)" = "d5e63fd144e18ba274ae7095c0197a870a7b9468abc801dd62f190d80817d2ec" +"checksum arc-swap 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d7b8a9123b8027467bce0099fe556c628a53c8d83df0507084c31e9ba2e39aff" +"checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +"checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" +"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +"checksum backtrace 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)" = "ad235dabf00f36301792cfe82499880ba54c6486be094d1047b02bacb67c14e8" +"checksum backtrace-sys 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)" = "e17b52e737c40a7d75abca20b29a19a0eb7ba9fc72c5a72dd282a0a3c2c0dc35" +"checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" +"checksum base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" +"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +"checksum bstr 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "502ae1441a0a5adb8fbd38a5955a6416b9493e92b465de5e4a9bde6a539c2c48" +"checksum bumpalo 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1f359dc14ff8911330a51ef78022d376f25ed00248912803b58f00cb1c27f742" +"checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +"checksum bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" +"checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" +"checksum cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4b9434b9a5aa1450faa3f9cb14ea0e8c53bb5d2b3c1bfd1ab4fc03e9f33fbfb0" +"checksum cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)" = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd" +"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" +"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +"checksum const-random 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "2f1af9ac737b2dd2d577701e59fd09ba34822f6f2ebdb30a7647405d9e55e16a" +"checksum const-random-macro 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "25e4c606eb459dd29f7c57b2e0879f2b6f14ee130918c2b78ccb58a9624e6c7a" +"checksum core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" +"checksum core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" +"checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" +"checksum criterion 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1fc755679c12bda8e5523a71e4d654b6bf2e14bd838dfc48cde6559a05caf7d1" +"checksum criterion-plot 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a01e15e0ea58e8234f96146b1f91fa9d0e4dd7a38da93ff7a75d42c0b9d3a545" +"checksum crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" +"checksum crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" +"checksum crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" +"checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +"checksum cssparser 0.25.9 (registry+https://github.com/rust-lang/crates.io-index)" = "fbe18ca4efb9ba3716c6da66cc3d7e673bf59fa576353011f48c4cfddbdd740e" +"checksum cssparser-macros 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "5bb1c84e87c717666564ec056105052331431803d606bd45529b28547b611eef" +"checksum csv 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "00affe7f6ab566df61b4be3ce8cf16bc2576bca0963ceb0955e45d514bf9a279" +"checksum csv-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" +"checksum distance 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6d9d8664cf849d7d0f3114a3a387d2f5e4303176d746d5a951aaddc66dfe9240" +"checksum dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" +"checksum dtoa-short 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "59020b8513b76630c49d918c33db9f4c91638e7d3404a28084083b87e33f76f2" +"checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" +"checksum encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)" = "cd8d03faa7fe0c1431609dfad7bbe827af30f82e1e2ae6f7ee4fca6bd764bc28" +"checksum error-chain 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d371106cc88ffdfb1eabd7111e432da544f16f3e2d7bf1dfe8bf575f1df045cd" +"checksum flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6bd6d6f4752952feb71363cffc9ebac9411b75b87c6ab6058c40c8900cf43c0f" +"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" +"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" +"checksum futf 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7c9c1ce3fa9336301af935ab852c437817d14cd33690446569392e65170aac3b" +"checksum futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5c329ae8753502fb44ae4fc2b622fa2a94652c41e795143765ba0927f92ab780" +"checksum futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8" +"checksum futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a" +"checksum futures-executor 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f674f3e1bcb15b37284a90cedf55afdba482ab061c407a9c0ebbd0f3109741ba" +"checksum futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a638959aa96152c7a4cddf50fcb1e3fede0583b27157c26e67d6f99904090dc6" +"checksum futures-macro 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9a5081aa3de1f7542a794a397cde100ed903b0630152d0973479018fd85423a7" +"checksum futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3466821b4bc114d95b087b850a724c6f83115e929bc88f1fa98a3304a944c8a6" +"checksum futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7b0a34e53cf6cdcd0178aa573aed466b646eb3db769570841fda0c7ede375a27" +"checksum futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "22766cf25d64306bedf0384da004d05c9974ab104fcc4528f1236181c18004c5" +"checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +"checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +"checksum h2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9d5c295d1c0c68e4e42003d75f908f5e16a1edd1cbe0b0d02e4dc2006a384f47" +"checksum hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" +"checksum hermit-abi 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1010591b26bbfe835e9faeabeb11866061cc7dcebffd56ad7d0942d0e61aefd8" +"checksum html5ever 0.25.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcf38a1a36118242d29b92e1b08ef84e67e4a5ed06e0a80be20e6a32bfed6b" +"checksum http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b708cc7f06493459026f53b9a61a7a121a5d1ec6238dee58ea4941132b30156b" +"checksum http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" +"checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +"checksum hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e7b15203263d1faa615f9337d79c1d37959439dc46c2b4faab33286fadc2a1c5" +"checksum hyper-tls 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3adcd308402b9553630734e9c36b77a7e48b3821251ca2493e8cd596763aafaa" +"checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" +"checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +"checksum indexmap 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "076f042c5b7b98f31d205f1249267e12a6518c1481e9dae9764af19b707d2292" +"checksum iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +"checksum itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" +"checksum itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" +"checksum js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "1cb931d43e71f560c81badb0191596562bafad2be06a3f9025b845c847c60df5" +"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +"checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" +"checksum libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)" = "eb147597cdf94ed43ab7a9038716637d2d1bf2bc571da995d0028dec06bd3018" +"checksum lifeguard 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eee00513d51f9a08737b74a286c761fc641114d1d5d6329beb11510049ec405f" +"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +"checksum lol_html 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "169299b3b58aa5cd8ad25fd8fe984e93748046d24c80f05aaadd9022f95423ec" +"checksum mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" +"checksum markup5ever 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aae38d669396ca9b707bfc3db254bc382ddb94f57cc5c235f34623a669a01dab" +"checksum markup5ever_rcdom 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f015da43bcd8d4f144559a3423f4591d69b8ce0652c905374da7205df336ae2b" +"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +"checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +"checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +"checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" +"checksum mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +"checksum mime_guess 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" +"checksum miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aa679ff6578b1cddee93d7e82e263b94a575e0bfced07284eb0c037c1d2416a5" +"checksum mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)" = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" +"checksum mio-named-pipes 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f5e374eff525ce1c5b7687c4cef63943e7686524a387933ad27ca7ec43779cb3" +"checksum mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "966257a94e196b11bb43aca423754d87429960a768de9414f3691d6957abf125" +"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" +"checksum miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "396aa0f2003d7df8395cb93e09871561ccc3e785f0acb369170e8cc74ddf9226" +"checksum native-tls 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "2b0d88c06fe90d5ee94048ba40409ef1d9315d86f6f38c2efdaad4fb50c58b2d" +"checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" +"checksum new_debug_unreachable 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +"checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" +"checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" +"checksum num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "46203554f085ff89c235cd12f7075f3233af9b11ed7c9e16dfe2560d03313ce6" +"checksum numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" +"checksum once_cell 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1c601810575c99596d4afc46f78a678c80105117c379eb3650cf99b8a21ce5b" +"checksum oorandom 11.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ebcec7c9c2a95cacc7cd0ecb89d8a8454eca13906f6deb55258ffff0adeb9405" +"checksum openssl 0.10.28 (registry+https://github.com/rust-lang/crates.io-index)" = "973293749822d7dd6370d6da1e523b0d1db19f06c459134c658b2a4261378b52" +"checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" +"checksum openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)" = "1024c0a59774200a555087a6da3f253a9095a5f344e353b212ac4c8b8e450986" +"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" +"checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +"checksum phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b3da44b85f8e8dfaec21adae67f95d93244b2ecf6ad2a692320598dcc8e6dd18" +"checksum phf 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" +"checksum phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b03e85129e324ad4166b06b2c7491ae27fe3ec353af72e72cd1654c7225d517e" +"checksum phf_codegen 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" +"checksum phf_generator 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "09364cc93c159b8b06b1f4dd8a4398984503483891b0c26b867cf431fb132662" +"checksum phf_generator 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" +"checksum phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "234f71a15de2288bcb7e3b6515828d22af7ec8598ee6d24c3b526fa0a80b67a0" +"checksum phf_shared 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" +"checksum pin-project 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7804a463a8d9572f13453c516a5faea534a2403d7ced2f0c7e100eeff072772c" +"checksum pin-project-internal 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "385322a45f2ecf3410c68d2a549a4a2685e8051d0f278e39743ff4e451cb9b3f" +"checksum pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "237844750cfbb86f67afe27eee600dfbbcb6188d734139b534cbfbf4f96792ae" +"checksum pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5894c618ce612a3fa23881b152b608bafb8c56cfc22f434a3ba3120b40f7b587" +"checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" +"checksum plotters 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "4e3bb8da247d27ae212529352020f3e5ee16e83c0c258061d27b08ab92675eeb" +"checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" +"checksum precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" +"checksum proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" +"checksum proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" +"checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +"checksum proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6c09721c6781493a2a492a96b5a5bf19b65917fe6728884e7c44dd0c60ca3435" +"checksum procedural-masquerade 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9a1574a51c3fd37b26d2c0032b649d08a7d51d4cca9c41bbc5bf7118fa4509d0" +"checksum psl 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0fcd4da9d98f254ad641dd081207cc14fcbec95dd58ee62ffc9b96f0684fd6c2" +"checksum psl-codegen 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "06f94f31e4f36b42e21b831d20bf0efc805b2155624697fb86f987b666518c3b" +"checksum psl-lexer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6cf84fe23023e855b9a9d038a1b08d5c438d3961d2ced6c2b2358b29fbf74a63" +"checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +"checksum quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" +"checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" +"checksum rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +"checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" +"checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" +"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +"checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" +"checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +"checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" +"checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +"checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" +"checksum rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" +"checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" +"checksum rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" +"checksum rand_pcg 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" +"checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" +"checksum rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" +"checksum rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" +"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" +"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" +"checksum regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "322cf97724bea3ee221b78fe25ac9c46114ebb51747ad5babd51a2fc6a8235a8" +"checksum regex-automata 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "92b73c2a1770c255c240eaa4ee600df1704a38dc3feaa6e949e7fcd4f8dc09f9" +"checksum regex-syntax 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)" = "1132f845907680735a84409c3bebc64d1364a5683ffbce899550cd09d5eaefc1" +"checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" +"checksum rental 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "8545debe98b2b139fb04cad8618b530e9b07c152d99a5de83c860b877d67847f" +"checksum rental-impl 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "475e68978dc5b743f2f40d8e0a8fdc83f1c5e78cbf4b8fa5e74e73beebc340de" +"checksum reqwest 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)" = "02b81e49ddec5109a9dcfc5f2a317ff53377c915e9ae9d4f2fb50914b85614e2" +"checksum rmp 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)" = "0f10b46df14cf1ee1ac7baa4d2fbc2c52c0622a4b82fa8740e37bc452ac0184f" +"checksum rmp-serde 0.13.7 (registry+https://github.com/rust-lang/crates.io-index)" = "011e1d58446e9fa3af7cdc1fb91295b10621d3ac4cb3a85cc86385ee9ca50cd3" +"checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" +"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +"checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" +"checksum safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" +"checksum same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +"checksum schannel 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "507a9e6e8ffe0a4e0ebb9a10293e62fdf7657c06f1b8bb07a8fcf697d2abf295" +"checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +"checksum seahash 3.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "58f57ca1d128a43733fd71d583e837b1f22239a37ebea09cde11d8d9a9080f47" +"checksum security-framework 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "97bbedbe81904398b6ebb054b3e912f99d55807125790f3198ac990d98def5b0" +"checksum security-framework-sys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "06fd2f23e31ef68dd2328cc383bd493142e46107a3a0e24f7d734e3f3b80fe4c" +"checksum selectors 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1b86b100bede4f651059740afc3b6cb83458d7401cb7c1ad96d8a11e91742c86" +"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +"checksum sequence_trie 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1ee22067b7ccd072eeb64454b9c6e1b33b61cd0d49e895fd48676a184580e0c3" +"checksum serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" +"checksum serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" +"checksum serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)" = "9371ade75d4c2d6cb154141b9752cf3781ec9c05e0e5cf35060e1e70ee7b9c25" +"checksum serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" +"checksum servo_arc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d98238b800e0d1576d8b6e3de32827c2d74bee68bb97748dcf5071fb53965432" +"checksum signal-hook-registry 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94f478ede9f64724c5d173d7bb56099ec3e2d9fc2774aac65d34b8b890405f41" +"checksum siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" +"checksum siphasher 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "83da420ee8d1a89e640d0948c646c1c088758d3a3c538f943bfa97bdac17929d" +"checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" +"checksum smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" +"checksum socket2 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "e8b74de517221a2cb01a53349cf54182acdc31a074727d3079068448c0676d85" +"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" +"checksum string_cache 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2940c75beb4e3bf3a494cef919a747a2cb81e52571e212bfbd185074add7208a" +"checksum string_cache_codegen 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f24c8e5e19d22a726626f1a5e16fe15b132dcf21d10177fa5a45ce7962996b97" +"checksum syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)" = "261ae9ecaa397c42b960649561949d69311f08eeaea86a65696e6e46517cf741" +"checksum syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)" = "123bd9499cfb380418d509322d7a6d52e5315f064fe4b3ad18a53d6b92c07859" +"checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +"checksum tendril 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "707feda9f2582d5d680d733e38755547a3e8fb471e7ba11452ecfd9ce93a5d3b" +"checksum termion 1.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c22cec9d8978d906be5ac94bceb5a010d885c626c4c8855721a4dbd20e3ac905" +"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +"checksum thin-slice 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" +"checksum thiserror 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ee14bf8e6767ab4c687c9e8bc003879e042a96fd67a3ba5934eadb6536bef4db" +"checksum thiserror-impl 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "a7b51e1fbc44b5a0840be594fbc0f960be09050f2617e61e6aa43bef97cd3ef4" +"checksum thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +"checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" +"checksum tinytemplate 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "57a3c6667d3e65eb1bc3aed6fd14011c6cbc3a0665218ab7f5daf040b9ec371a" +"checksum tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "0fa5e81d6bc4e67fe889d5783bd2a128ab2e0cfa487e0be16b6a8d177b101616" +"checksum tokio-macros 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389" +"checksum tokio-tls 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7bde02a3a5291395f59b06ec6945a3077602fac2b07eeeaf0dee2122f3619828" +"checksum tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "571da51182ec208780505a32528fc5512a8fe1443ab960b3f2f3ef093cd16930" +"checksum tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" +"checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" +"checksum twoway 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6b40075910de3a912adbd80b5d8bad6ad10a23eeb1f5bf9d4006839e899ba5bc" +"checksum unchecked-index 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c" +"checksum unicase 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +"checksum unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "141339a08b982d942be2ca06ff8b076563cbe223d1befd5450716790d44e2426" +"checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" +"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" +"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +"checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" +"checksum url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" +"checksum utf-8 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "05e42f7c18b8f902290b009cde6d651262f956c98bc51bca4cd1d511c9cd85c7" +"checksum vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" +"checksum version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" +"checksum walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +"checksum want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +"checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +"checksum wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "3557c397ab5a8e347d434782bcd31fc1483d927a6826804cec05cc792ee2519d" +"checksum wasm-bindgen-backend 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "e0da9c9a19850d3af6df1cb9574970b566d617ecfaf36eb0b706b6f3ef9bd2f8" +"checksum wasm-bindgen-futures 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "457414a91863c0ec00090dba537f88ab955d93ca6555862c29b6d860990b8a8a" +"checksum wasm-bindgen-macro 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "0f6fde1d36e75a714b5fe0cffbb78978f222ea6baebb726af13c78869fdb4205" +"checksum wasm-bindgen-macro-support 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "25bda4168030a6412ea8a047e27238cadf56f0e53516e1e83fec0a8b7c786f6d" +"checksum wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "fc9f36ad51f25b0219a3d4d13b90eb44cd075dff8b6280cca015775d7acaddd8" +"checksum web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "721c6263e2c66fd44501cc5efbfa2b7dfa775d13e4ea38c46299646ed1f9c70a" +"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" +"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfbf554c6ad11084fb7517daca16cfdcaccbdadba4fc336f032a8b12c2ad80" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +"checksum winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" +"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +"checksum xml5ever 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b1b52e6e8614d4a58b8e70cf51ec0cc21b256ad8206708bcff8139b5bbd6a59" diff --git a/components/speedreader/rust/lib/Cargo.toml b/components/speedreader/rust/lib/Cargo.toml new file mode 100644 index 000000000000..dd8d3918e354 --- /dev/null +++ b/components/speedreader/rust/lib/Cargo.toml @@ -0,0 +1,54 @@ +[package] +name = "speedreader" +version = "0.1.0" +authors = [ + "gpestana ", + "Andrius Aucinas " +] +edition = "2018" + +include = [ + "/Cargo.toml", + "/build.rs", + "/LICENSE", + "/README.md", + "/src/*", + "/examples/*.rs", + "/benches/*" +] + +[dependencies] +html5ever = "0.25.1" +markup5ever_rcdom = "0.1.0" +regex = "1" +lol_html = { version = "0.2.0" } +thiserror = "1.0.2" +adblock = "0.2.7" +serde = { version = "1.0.104", features = ["derive"] } +serde_json = "1.0.48" +flate2 = { version = "1.0.12", features = ["rust_backend"], default-features = false } + +# Pin versions compatible with rustc 1.35.0 +url = "=1.7.2" +unicode-normalization = "=0.1.8" +smallvec = "=0.6.13" + +readability = { path = "src/readability" } +lazy_static = "1.3" +markup5ever = "0.10" + +[build-dependencies] +regex = "1" + +[dev-dependencies] +matches = "0.1" +distance = "0.4.0" +termion = "1.5" +reqwest = { version = "0.10.2", features = ["blocking", "stream"] } +criterion = "0.3" +futures = "0.3" +tokio = { version = "0.2", features = ["full"] } + +[[bench]] +name = "lolhtml" +harness = false diff --git a/components/speedreader/rust/lib/README.md b/components/speedreader/rust/lib/README.md new file mode 100644 index 000000000000..16bef75b3380 --- /dev/null +++ b/components/speedreader/rust/lib/README.md @@ -0,0 +1,24 @@ +# Brave SpeedReader + +At a high level, SpeedReader: + +* Distills text-focused document content from a suitable HTML +* Works on HTML documents before rendering them +* Generates HTML output with no external styling or scripting +* Content styled with Brave-designed themes + +## Structure + +SpeedReader has two methods of deciding whether a page is readable: + +* `classifier` that analyses HTML content of a page and applies a pre-trained + classifier to decide whether the page is article-style, text-oriented +* `whitelist` that uses adblock-style rules that explciitly whitelist pages that + should be distilled + +Any page that is readable should then be passed to an instance of `SpeedReader` +. Internally it uses the `whitelist` to determine whether to apply streaming, +rule-based rewriting (using [lol_html](https://github.com/cloudflare/lol-html) +to support output streaming), or heuristics approach loosely based on [Mozilla's +Readability](https://github.com/mozilla/readability) and Rust implementation +improved from https://github.com/kumabook/readability. diff --git a/components/speedreader/rust/lib/benches/lolhtml.rs b/components/speedreader/rust/lib/benches/lolhtml.rs new file mode 100644 index 000000000000..06e40b85a64f --- /dev/null +++ b/components/speedreader/rust/lib/benches/lolhtml.rs @@ -0,0 +1,60 @@ +extern crate reqwest; +extern crate speedreader; +extern crate url; + +use criterion::{black_box, criterion_group, criterion_main, Criterion}; + +fn bench_lolhtml(c: &mut Criterion) { + let article_url = "https://www.cnet.com/roadshow/features/2020-acura-nsx-road-trip-daytona/"; + + let client = reqwest::blocking::Client::new(); + let data = client.get(article_url).send().unwrap().text().unwrap(); + let sr = speedreader::SpeedReader::default(); + let config = sr.get_rewriter_type(article_url); + assert!(config == speedreader::RewriterType::Streaming); + let user_data = sr.get_opaque_config(article_url); + + c.bench_function("lolhtml-cnet", |b| { + b.iter(|| { + let mut output = vec![]; + let mut rewriter = sr + .get_rewriter( + article_url, + &user_data, + black_box(|c: &[u8]| output.extend_from_slice(c)), + Some(config), + ) + .unwrap(); + rewriter.write(data.as_bytes()).ok(); + rewriter.end().ok(); + }) + }); +} + +fn bench_html5ever(c: &mut Criterion) { + let article_url = "https://www.cnet.com/roadshow/features/2020-acura-nsx-road-trip-daytona/"; + + let client = reqwest::blocking::Client::new(); + let data = client.get(article_url).send().unwrap().text().unwrap(); + let sr = speedreader::SpeedReader::with_whitelist(speedreader::whitelist::Whitelist::default()); + let user_data = sr.get_opaque_config(article_url); + + c.bench_function("html5ever-cnet", |b| { + b.iter(|| { + let mut output = vec![]; + let mut rewriter = sr + .get_rewriter( + article_url, + &user_data, + black_box(|c: &[u8]| output.extend_from_slice(c)), + Some(speedreader::RewriterType::Heuristics), + ) + .unwrap(); + rewriter.write(data.as_bytes()).ok(); + rewriter.end().ok(); + }) + }); +} + +criterion_group!(benches, bench_lolhtml, bench_html5ever); +criterion_main!(benches); diff --git a/components/speedreader/rust/lib/build.rs b/components/speedreader/rust/lib/build.rs new file mode 100644 index 000000000000..a9ad10c23781 --- /dev/null +++ b/components/speedreader/rust/lib/build.rs @@ -0,0 +1,135 @@ +use std::env; +use std::fs::File; +use std::io::Write; +use std::path::Path; + +extern crate regex; +use regex::Regex; + +// use crate::classifier::{N_FEATURES, N_CLASSES}; + +fn main() { + let out_dir = env::var("OUT_DIR").unwrap(); + let dest_path = Path::new(&out_dir).join("predictor.rs"); + let mut f = File::create(&dest_path).unwrap(); + + let model = include_str!("src/classifier/model.c"); + + let main_remove = Regex::new( + r###"(?ms)^int main\(int argc, const char \* argv\[\]\) \{ +.* +\s+return 0; +}"###, + ) + .unwrap(); + + let transformed = main_remove.replace(model, ""); + + let predictor_f_regex = Regex::new( + r"(?m)^int predict_(?P\d+)\(float features\[\]\) \{ +\s+int classes\[\d+\]; +(?P(\s+.*\n)*\s+\}) +\s+int class_idx = 0; +\s+int class_val = classes\[0\]; +\s+int i; +\s+for \(i = \d+; i < \d+; i\+\+\) \{ +\s+if \(classes\[i\] > class_val\) \{ +\s+class_idx = i; +\s+class_val = classes\[i\]; +\s+\} +\s+\} +\s+return class_idx; +\}$ +", + ) + .unwrap(); + + let mut predictors: Vec<_> = Vec::new(); + for predictor in predictor_f_regex.captures_iter(&transformed) { + let predictor_id_str = &predictor["predictor"]; + let predictor_id = predictor_id_str.parse::().unwrap(); + println!("Predictor {}", predictor_id); + let body = &predictor["body"]; + println!( + "Got predictor {} starting with {}, ending {}, len {}", + predictor_id, + &body[..100], + &body[body.len() - 100..], + body.len() + ); + predictors.push((predictor_id, body.to_owned())); + } + + let generated_predictors = predictors + .iter() + .map(|(p_id, body)| { + format!( + r###" +fn predict_{id}(features: &[f32; N_FEATURES])-> usize {{ + let mut classes: [i32; N_CLASSES] = Default::default(); + + {body} + + let mut class_idx = 0; + let mut class_val = classes[0]; + for i in 0..N_CLASSES {{ + if classes[i] > class_val {{ + class_idx = i; + class_val = classes[i]; + }} + }} + class_idx +}} +"###, + id = p_id, + body = body + ) + }) + .collect::>() + .join("\n"); + + let f_predict_body = predictors + .iter() + .map(|(p_id, _)| { + format!( + r###" + let p{id} = predict_{id}(features); + classes[p{id}] = classes[p{id}] + 1; + "###, + id = p_id + ) + }) + .collect::>() + .join("\n"); + + let generated = format!( + r###" + +pub const N_FEATURES: usize = {features}; +pub const N_CLASSES: usize = {classes}; + +pub fn predict(features: &[f32; N_FEATURES])-> usize {{ + let mut classes: [i32; N_CLASSES] = Default::default(); + {f_predict_body} + + let mut class_idx: usize = 0; + let mut class_val = classes[0]; + for i in 0..N_CLASSES {{ + if classes[i] > class_val {{ + class_idx = i; + class_val = classes[i]; + }} + }} + class_idx +}} + +{predictors} + "###, + features = 21, + classes = 2, + f_predict_body = &f_predict_body, + predictors = &generated_predictors + ); + + f.write_all(&generated.as_bytes()).unwrap(); +} diff --git a/components/speedreader/rust/lib/examples/classifier.rs b/components/speedreader/rust/lib/examples/classifier.rs new file mode 100644 index 000000000000..1bf22815bf32 --- /dev/null +++ b/components/speedreader/rust/lib/examples/classifier.rs @@ -0,0 +1,21 @@ +use speedreader::classifier::feature_extractor::FeatureExtractorStreamer; +use speedreader::classifier::Classifier; +use std::fs; +use url::Url; + +fn main() { + let url = Url::parse("http://example.com/hello/world/hello?again").unwrap(); + let doc_path = "data/classifier/2CdyGKStt9jwu5u.html"; + //let doc_path = "data/classifier/gp-ex2.html"; + //let doc_path = "data/classifier/gp-index.html"; + //let doc_path = "data/classifier/simple.html"; + + let data = fs::read_to_string(doc_path).expect("err to string"); + + let mut feature_extractor = FeatureExtractorStreamer::try_new(&url).unwrap(); + feature_extractor.write(&mut data.as_bytes()).unwrap(); + let result = feature_extractor.end(); + + let result = Classifier::from_feature_map(&result.features).classify(); + println!("{}", result); +} diff --git a/components/speedreader/rust/lib/examples/feature_extraction.rs b/components/speedreader/rust/lib/examples/feature_extraction.rs new file mode 100644 index 000000000000..d1d11e36d260 --- /dev/null +++ b/components/speedreader/rust/lib/examples/feature_extraction.rs @@ -0,0 +1,22 @@ +extern crate speedreader; + +use speedreader::classifier::feature_extractor::FeatureExtractorStreamer; +use std::fs; +use url::Url; + +fn main() { + let url = Url::parse("http://example.com/hello/world/hello?again").unwrap(); + let doc_path = "data/classifier/2CdyGKStt9jwu5u.html"; + //let doc_path = "data/classifier/gp-ex2.html"; + //let doc_path = "data/classifier/simple.html"; + + let data = fs::read_to_string(doc_path).expect("err to string"); + + let mut feature_extractor = FeatureExtractorStreamer::try_new(&url).unwrap(); + feature_extractor.write(&mut data.as_bytes()).unwrap(); + let result = feature_extractor.end(); + + for (k, v) in result.features.iter() { + println!("{}: {}", k, v); + } +} diff --git a/components/speedreader/rust/lib/examples/feature_extraction_streamer.rs b/components/speedreader/rust/lib/examples/feature_extraction_streamer.rs new file mode 100644 index 000000000000..116c8fd65c4b --- /dev/null +++ b/components/speedreader/rust/lib/examples/feature_extraction_streamer.rs @@ -0,0 +1,34 @@ +extern crate speedreader; + +use readability::extractor::extract_dom; + +use speedreader::classifier::feature_extractor::FeatureExtractorStreamer; +use std::fs; +use url::Url; + +fn main() { + let url = Url::parse("http://example.com/hello/world/hello?again").unwrap(); + let frag1 = fs::read_to_string("data/classifier/bbc_new.html").expect("err to string"); + let frag2 = fs::read_to_string("data/classifier/bbc_new1.html").expect("err to string"); + let frag3 = fs::read_to_string("data/classifier/bbc_new2.html").expect("err to string"); + + let mut streamer = FeatureExtractorStreamer::try_new(&url).unwrap(); + + streamer.write(&mut frag1.as_bytes()).unwrap(); + streamer.write(&mut frag2.as_bytes()).unwrap(); + streamer.write(&mut frag3.as_bytes()).unwrap(); + + let sink = streamer.end(); + + println!("======\n Features returned sink:"); + let result = sink.features.clone(); + for (k, v) in result.iter() { + println!("{}: {}", k, v) + } + + let product = extract_dom(&mut sink.rcdom, &url, &sink.features).unwrap(); + println!(">> Read mode:\n {:?}", product); + // parsing errors may happen due to malformed HTML, but it will not affect + // parsing itself or the DOM tree building + println!("Errors: {:?}", sink.rcdom.errors); +} diff --git a/components/speedreader/rust/lib/examples/fetch-transform.rs b/components/speedreader/rust/lib/examples/fetch-transform.rs new file mode 100644 index 000000000000..3ecf351b03ca --- /dev/null +++ b/components/speedreader/rust/lib/examples/fetch-transform.rs @@ -0,0 +1,76 @@ +extern crate reqwest; +extern crate speedreader; +extern crate url; + +use readability::extractor::extract_dom; +use serde_json::json; +use speedreader::classifier::feature_extractor::FeatureExtractorStreamer; +use speedreader::classifier::Classifier; +use std::collections::hash_map::DefaultHasher; +use std::env; +use std::fs; +use std::hash::{Hash, Hasher}; +use std::io::prelude::*; +use url::Url; + +fn calculate_hash(t: &T) -> u64 { + let mut s = DefaultHasher::new(); + t.hash(&mut s); + s.finish() +} + +fn main() { + let args: Vec = env::args().collect(); + let article_url = &args[1]; + + let url = Url::parse(article_url).unwrap(); + + let client = reqwest::blocking::Client::new(); + let data = client.get(article_url) + .header(reqwest::header::COOKIE, "") + .send() + .unwrap() + .text() + .unwrap(); + + let dir = format!( + "data/pages/{}/{}", + url.host().unwrap(), + calculate_hash(article_url) + ); + println!("Creating directory: {}", dir); + fs::create_dir_all(&dir).unwrap_or_default(); + + let filename_html = format!("{}/init.html", &dir); + let mut file = fs::File::create(filename_html).unwrap(); + file.write_all(data.as_bytes()).unwrap(); + + // feature extraction + let mut feature_extractor = FeatureExtractorStreamer::try_new(&url).unwrap(); + feature_extractor.write(&mut data.as_bytes()).unwrap(); + let result = feature_extractor.end(); + + // document classification + let classifier_result = Classifier::from_feature_map(&result.features).classify(); + println!(">> Readble?\n {}", classifier_result); + + if classifier_result > 0 { + // document mapper + let product = extract_dom(&mut result.rcdom, &url, &result.features).unwrap(); + let filename_html = format!("{}/mapped.html", &dir); + let mut file = fs::File::create(filename_html).unwrap(); + file.write_all(product.content.as_bytes()).unwrap(); + } + + // Metadata + let metadata = json!({ + "host": url.host().unwrap().to_string(), + "url": url.into_string(), + "hash": calculate_hash(article_url), + "readable": classifier_result, + "correct": "tbd" + }); + let filename_html = format!("{}/metadata.json", &dir); + let mut file = fs::File::create(filename_html).unwrap(); + file.write_all(metadata.to_string().as_bytes()).unwrap(); +} diff --git a/components/speedreader/rust/lib/examples/lolhtml.rs b/components/speedreader/rust/lib/examples/lolhtml.rs new file mode 100644 index 000000000000..fbecd5c88778 --- /dev/null +++ b/components/speedreader/rust/lib/examples/lolhtml.rs @@ -0,0 +1,84 @@ +extern crate reqwest; +extern crate speedreader; +extern crate url; + +use std::collections::hash_map::DefaultHasher; +use std::env; +use std::error::Error; +use std::fs; +use std::hash::{Hash, Hasher}; +use std::io::prelude::*; +use url::Url; + +use speedreader::*; + +fn calculate_hash(t: &T) -> u64 { + let mut s = DefaultHasher::new(); + t.hash(&mut s); + s.finish() +} + +const USER_AGENT: &'static str = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36"; + +async fn stream_content(article_url: &str) -> Result<(), Box> { + let url = Url::parse(article_url).unwrap(); + + let dir = format!( + "data/lolhtml/{}/{}", + url.host().unwrap(), + calculate_hash(&article_url) + ); + println!("Creating directory: {}", dir); + fs::create_dir_all(&dir).unwrap_or_default(); + + let client = reqwest::Client::new(); + let mut data = client + .get(url.as_str()) + .header("cookie", r#""#) + .header("referer", "https://www.usnews.com/") + .header("sec-fetch-dest", "document") + .header("sec-fetch-mode", "navigate") + .header("sec-fetch-site", "same-origin") + .header("sec-fetch-user", "?1") + .header("user-agent", USER_AGENT) + .send() + .await?; + + let mut mapped_file = fs::File::create(format!("{}/mapped.html", &dir))?; + let mut mapped_test_file = + fs::File::create(format!("{}/mapped.html", "data/lolhtml/test"))?; + + let sr = SpeedReader::default(); + let config = sr.get_rewriter_type(article_url); + let opaque = sr.get_opaque_config(article_url); + let mut rewriter = sr.get_rewriter( + article_url, + &opaque, + |c: &[u8]| { + mapped_file.write_all(c).ok(); + mapped_test_file.write_all(c).ok(); + }, + Some(config), + )?; + + let mut init_file = fs::File::create(format!("{}/init.html", &dir))?; + let mut init_test_file = fs::File::create(format!("{}/init.html", "data/lolhtml/test"))?; + while let Some(chunk) = data.chunk().await? { + rewriter.write(chunk.as_ref()).ok(); + init_file.write_all(chunk.as_ref()).ok(); + init_test_file.write_all(chunk.as_ref()).ok(); + } + + rewriter.end()?; + + Ok(()) +} + +#[tokio::main] +async fn main() -> Result<(), Box> { + let args: Vec = env::args().collect(); + let article_url = &args[1]; + stream_content(article_url).await?; + + Ok(()) +} diff --git a/components/speedreader/rust/lib/examples/whitelist.rs b/components/speedreader/rust/lib/examples/whitelist.rs new file mode 100644 index 000000000000..ea2ce98cb02c --- /dev/null +++ b/components/speedreader/rust/lib/examples/whitelist.rs @@ -0,0 +1,127 @@ +extern crate adblock; +extern crate reqwest; +extern crate speedreader; +extern crate url; + +use std::fs; +use std::io; + +fn main() -> io::Result<()> { + let mut correct = true; + let mut full_whitelist = Vec::new(); + for entry in fs::read_dir("data/urls/")? { + let entry = entry?; + if entry.file_type()?.is_dir() { + let path = entry.path(); + println!("Processing {:?}", path); + let mut readable_path = path.clone(); + readable_path.push("readable.txt"); + let expected_readable = fs::read_to_string(&readable_path)? + .split_ascii_whitespace() + .map(|s: &str| s.to_owned()) + .collect::>(); + + let mut unreadable_path = path.clone(); + unreadable_path.push("unreadable.txt"); + let expected_unreadable = fs::read_to_string(&unreadable_path)? + .split_ascii_whitespace() + .map(|s: &str| s.to_owned()) + .collect::>(); + + let mut whitelist_path = path.clone(); + whitelist_path.push("whitelist.txt"); + let mut whitelist = fs::read_to_string(&whitelist_path)? + .split('\n') + .map(|s: &str| s.trim().to_owned()) + .filter(|f| detect_network_filter(f)) + .collect::>(); + + let adblock_matcher = adblock::engine::Engine::from_rules_debug(&whitelist); + + for url in expected_readable { + let check = adblock_matcher.check_network_urls(&url, &url, ""); + if !check.matched { + println!("Error: expected {} to match provided filters", url); + correct = false; + } + } + + for url in expected_unreadable { + let check = adblock_matcher.check_network_urls(&url, &url, ""); + if check.matched { + println!( + "Error: expected {} to not match provided filters, but matched {:?}", + url, check.filter + ); + correct = false; + } + } + + if correct { + full_whitelist.append(&mut whitelist); + } + } + } + + let whitelist_filename = "whitelist.txt"; + println!( + "Everything correct, writing used rules to {}", + whitelist_filename + ); + fs::write(whitelist_filename, full_whitelist.join("\n").as_bytes())?; + Ok(()) +} + +/** + * Given a single line (string), checks if this would likely be a cosmetic + * filter, a network filter or something that is not supported. This check is + * performed before calling a more specific parser to create an instance of + * `NetworkFilter` or `CosmeticFilter`. + */ +fn detect_network_filter(filter: &str) -> bool { + // Ignore comments + if filter.len() == 1 + || filter.starts_with('!') + || (filter.starts_with('#') && filter[1..].starts_with(char::is_whitespace)) + || filter.starts_with("[Adblock") + { + return false; + } + + if filter.starts_with('|') || filter.starts_with("@@|") { + return true; + } + + // Ignore Adguard cosmetics + // `$$` + if filter.find("$$").is_some() { + return false; + } + + // Check if filter is cosmetics + if let Some(sharp_index) = filter.find('#') { + let after_sharp_index = sharp_index + 1; + + // Ignore Adguard cosmetics + // `#$#` `#@$#` + // `#%#` `#@%#` + // `#?#` + if filter[after_sharp_index..].starts_with(/* #@$# */ "@$#") + || filter[after_sharp_index..].starts_with(/* #@%# */ "@%#") + || filter[after_sharp_index..].starts_with(/* #%# */ "%#") + || filter[after_sharp_index..].starts_with(/* #$# */ "$#") + || filter[after_sharp_index..].starts_with(/* #?# */ "?#") + { + return false; + } else if filter[after_sharp_index..].starts_with(/* ## */ '#') + || filter[after_sharp_index..].starts_with(/* #@# */ "@#") + { + // Parse supported cosmetic filter + // `##` `#@#` + return false; + } + } + + // Everything else is a network filter + true +} diff --git a/components/speedreader/rust/lib/src/classifier/feature_extractor.rs b/components/speedreader/rust/lib/src/classifier/feature_extractor.rs new file mode 100644 index 000000000000..becd06f99c6f --- /dev/null +++ b/components/speedreader/rust/lib/src/classifier/feature_extractor.rs @@ -0,0 +1,311 @@ +use html5ever::driver::{ParseOpts, Parser}; +use markup5ever_rcdom::{Handle, NodeData, RcDom}; +use html5ever::tendril::*; +use html5ever::tree_builder::{AppendText, ElementFlags, NodeOrText, QuirksMode, TreeSink}; +use html5ever::{Attribute, ExpandedName, QualName}; +use std::borrow::Cow; +use std::clone::Clone; +use std::collections::HashMap; +use std::default::Default; +use std::string::String; +use std::vec::Vec; +use url::Url; + +use crate::speedreader::SpeedReaderError; + +// Feature extractor which accepts chunks of data to parse +pub struct FeatureExtractorStreamer { + inner: Parser, +} + +impl FeatureExtractorStreamer { + pub fn try_new(url: &Url) -> Result { + let mut sink = FeaturisingTreeSink::default(); + sink.features.insert( + "url_depth".to_string(), + url_depth(url).unwrap_or_default() as u32, + ); + + let parser = html5ever::parse_document(sink, ParseOpts::default()); + + Ok(FeatureExtractorStreamer { inner: parser }) + } + + pub fn write(&mut self, fragment: &mut &[u8]) -> Result<(), ()> { + let tend = StrTendril::try_from_byte_slice(fragment)?; + self.inner.process(tend); + Ok(()) + } + + pub fn end(&mut self) -> &mut FeaturisingTreeSink { + &mut self.inner.tokenizer.sink.sink + } + + pub fn features(&self) -> &HashMap { + &self.inner.tokenizer.sink.sink.features + } +} + +fn url_depth(url: &Url) -> Result { + url.path_segments() + .map(std::iter::Iterator::count) // want number of segments only + .ok_or_else(|| SpeedReaderError::InvalidUrl(url.as_str().to_owned())) // return error +} + +pub struct FeaturisingTreeSink { + pub features: HashMap, + pub rcdom: RcDom, +} + +impl Clone for FeaturisingTreeSink { + fn clone(&self) -> Self { + let mut cloned_f = HashMap::new(); + for (k, v) in self.features.iter() { + cloned_f.insert(k.to_string(), *v); + } + let cloned_r = RcDom { + document: self.rcdom.document.clone(), + errors: self.rcdom.errors.clone(), + quirks_mode: self.rcdom.quirks_mode, + }; + + FeaturisingTreeSink { + features: cloned_f, + rcdom: cloned_r, + } + } +} + +impl Default for FeaturisingTreeSink { + fn default() -> FeaturisingTreeSink { + FeaturisingTreeSink { + features: HashMap::new(), + rcdom: RcDom::default(), + } + } +} + +impl TreeSink for FeaturisingTreeSink { + type Output = Self; + type Handle = Handle; + fn finish(self) -> Self { + self + } + + // everytime the parser identifies a new element, our sink will figure out + // if the element is part of the subset used by our classifier. if that is + // the case, increases the respective feature counter. + fn create_element( + &mut self, + name: QualName, + attrs: Vec, + flags: ElementFlags, + ) -> Handle { + // increases count on feature map for selected tags + let elem = name.local.to_string(); + self.features + .entry(elem.clone()) + .and_modify(|v| *v += 1) + .or_insert(1); + + // seaches for `` + if elem == "meta" { + for a in attrs.clone() { + let attr = a.value.to_string(); + + if attr.starts_with("og:") { + self.features + .entry("og_article".to_string()) + .and_modify(|v| *v = 1) + .or_insert(1); + } + + if attr.starts_with("fb:") { + self.features + .entry("fb_pages".to_string()) + .and_modify(|v| *v = 1) + .or_insert(1); + } + } + } + + // checks if page is AMP compatible + if elem == "link" { + for a in attrs.clone() { + if a.value.to_string() == "amphtml" { + self.features + .entry("amphtml".to_string()) + .and_modify(|v| *v = 1) + .or_insert(1); + } + } + } + + // checks if element has namespace `ns:schema.org:Article` or `ns:schema.org:NewsArticle` + for a in attrs.clone() { + if a.value + .to_string() + .starts_with("https://schema.org/Article") + || a.value + .to_string() + .starts_with("https://schema.org/NewsArticle") + { + self.features + .entry("schema_org".to_string()) + .and_modify(|v| *v = 1) + .or_insert(1); + } + } + + self.rcdom.create_element(name, attrs, flags) + } + + // everytime the append node is required from our sink, it will either + // 1) update the tag level tracker by setting the new node's level as +1 + // from its parent and + // 2) if the node to append is of type `text`, it will proceed to calculate + // the number of words in the text node and add that information to the + // feature list. It will also decide whether the text is a `text_block` + // and update the feature list accordingly. + fn append(&mut self, parent: &Handle, child: NodeOrText) { + if let AppendText(text) = &child { + if let NodeData::Element { name, .. } = &parent.data { + let parent_name = name.local.to_string(); + + if parent_name == "p" { + let parent_level = node_depth(parent, 11, 1); + let num_words = text.split_whitespace().count(); + + // words + self.features + .entry("words".to_string()) + .and_modify(|v| *v += num_words as u32) + .or_insert(num_words as u32); + + let text_blocks = self.features.entry("text_blocks".to_string()).or_insert(0); + + // text_blocks + if num_words > 400 && parent_level > 1 && parent_level < 11 { + *text_blocks += 1; + } + } + } + } + + self.rcdom.append(parent, child) + } + + // Default TreeSink meethods from rcdom + + fn parse_error(&mut self, msg: Cow<'static, str>) { + self.rcdom.parse_error(msg); + } + + fn get_document(&mut self) -> Handle { + self.rcdom.get_document() + } + + fn get_template_contents(&mut self, target: &Handle) -> Handle { + self.rcdom.get_template_contents(target) + } + + fn set_quirks_mode(&mut self, mode: QuirksMode) { + self.rcdom.set_quirks_mode(mode) + } + + fn same_node(&self, x: &Handle, y: &Handle) -> bool { + self.rcdom.same_node(x, y) + } + + fn elem_name<'a>(&'a self, target: &'a Handle) -> ExpandedName<'a> { + self.rcdom.elem_name(target) + } + + fn create_comment(&mut self, text: StrTendril) -> Handle { + self.rcdom.create_comment(text) + } + + fn create_pi(&mut self, target: StrTendril, content: StrTendril) -> Handle { + self.rcdom.create_pi(target, content) + } + + fn append_before_sibling(&mut self, sibling: &Handle, child: NodeOrText) { + self.rcdom.append_before_sibling(sibling, child) + } + + fn append_based_on_parent_node( + &mut self, + element: &Handle, + prev_element: &Handle, + child: NodeOrText, + ) { + self.rcdom + .append_based_on_parent_node(element, prev_element, child) + } + + fn append_doctype_to_document( + &mut self, + name: StrTendril, + public_id: StrTendril, + system_id: StrTendril, + ) { + self.rcdom + .append_doctype_to_document(name, public_id, system_id); + } + + fn add_attrs_if_missing(&mut self, target: &Handle, attrs: Vec) { + self.rcdom.add_attrs_if_missing(target, attrs); + } + + fn remove_from_parent(&mut self, target: &Handle) { + self.rcdom.remove_from_parent(target); + } + + fn reparent_children(&mut self, node: &Handle, new_parent: &Handle) { + self.rcdom.reparent_children(node, new_parent); + } + + fn mark_script_already_started(&mut self, target: &Handle) { + self.rcdom.mark_script_already_started(target); + } +} + +fn node_depth(node: &Handle, max_depth: usize, current_depth: usize) -> usize { + if current_depth > max_depth { + return current_depth; + } + if let Some(parent) = node.parent.take() { + if let Some(strong_parent) = parent.upgrade() { + node_depth(&strong_parent, max_depth, current_depth + 1) + } else { + current_depth + } + } else { + current_depth + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_depth_url() { + assert_eq!(url_depth(&Url::parse("http://url.com").unwrap()), Ok(1)); + assert_eq!(url_depth(&Url::parse("http://url.com/").unwrap()), Ok(1)); + + assert_eq!( + url_depth(&Url::parse("http://url.com/another/path/here?test").unwrap()), + Ok(3) + ); + + assert_eq!( + url_depth(&Url::parse("https://www.url.com/another/path").unwrap()), + Ok(2) + ); + assert!(matches!( + url_depth(&Url::parse("data:text/plain,HelloWorld").unwrap()), + Err(SpeedReaderError::InvalidUrl(_)) + )); + } +} diff --git a/components/speedreader/rust/lib/src/classifier/mod.rs b/components/speedreader/rust/lib/src/classifier/mod.rs new file mode 100644 index 000000000000..73411137cbd2 --- /dev/null +++ b/components/speedreader/rust/lib/src/classifier/mod.rs @@ -0,0 +1,53 @@ +pub mod feature_extractor; +mod model; +use std::collections::HashMap; + +use model::predict; +use model::N_FEATURES; + +pub struct Classifier { + features_list: [f32; N_FEATURES], +} + +impl Classifier { + pub fn from_feature_map(features: &HashMap) -> Classifier { + //let features_list: [f32; N_FEATURES] = [0.0; N_FEATURES]; + + let features_list = convert_map(features); + Classifier { features_list } + } + + pub fn classify(&self) -> usize { + predict(&self.features_list) + } +} + +// helpers +fn convert_map(map: &HashMap) -> [f32; N_FEATURES] { + let mut slice: [f32; N_FEATURES] = [0.0; N_FEATURES]; + + slice[0] = map.get("img").cloned().unwrap_or(0) as f32; + slice[1] = map.get("a").cloned().unwrap_or(0) as f32; + slice[2] = map.get("script").cloned().unwrap_or(0) as f32; + slice[3] = map.get("text_blocks").cloned().unwrap_or(0) as f32; + slice[4] = map.get("words").cloned().unwrap_or(0) as f32; + slice[5] = map.get("blockquote").cloned().unwrap_or(0) as f32; + slice[6] = map.get("dl").cloned().unwrap_or(0) as f32; + slice[7] = map.get("div").cloned().unwrap_or(0) as f32; + slice[8] = map.get("ol").cloned().unwrap_or(0) as f32; + slice[9] = map.get("p").cloned().unwrap_or(0) as f32; + slice[10] = map.get("pre").cloned().unwrap_or(0) as f32; + slice[11] = map.get("table").cloned().unwrap_or(0) as f32; + slice[12] = map.get("ul").cloned().unwrap_or(0) as f32; + slice[13] = map.get("select").cloned().unwrap_or(0) as f32; + slice[14] = map.get("article").cloned().unwrap_or(0) as f32; + slice[15] = map.get("section").cloned().unwrap_or(0) as f32; + slice[16] = map.get("url_depth").cloned().unwrap_or(0) as f32; + slice[17] = map.get("amphtml").cloned().unwrap_or(0) as f32; + slice[18] = map.get("fb_pages").cloned().unwrap_or(0) as f32; + slice[19] = map.get("og_article").cloned().unwrap_or(0) as f32; + slice[20] = map.get("schema_org").cloned().unwrap_or(0) as f32; + //slice[21] = map.get("file_size").cloned().unwrap_or(0) as f32; + + slice +} diff --git a/components/speedreader/rust/lib/src/classifier/model.c b/components/speedreader/rust/lib/src/classifier/model.c new file mode 100644 index 000000000000..a21a00744d7c --- /dev/null +++ b/components/speedreader/rust/lib/src/classifier/model.c @@ -0,0 +1,43338 @@ +#include +#include +#include + +int predict_0(float features[]) { + int classes[2]; + + if (features[18] <= 0.5) { + if (features[12] <= 1.5) { + if (features[16] <= 5.5) { + if (features[17] <= 0.5) { + if (features[16] <= 1.5) { + classes[0] = 265; + classes[1] = 0; + } else { + if (features[12] <= 0.5) { + if (features[1] <= 13.0) { + classes[0] = 25; + classes[1] = 0; + } else { + if (features[7] <= 105.5) { + if (features[9] <= 7.5) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[11] <= 3.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[9] <= 1.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[2] <= 14.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + classes[0] = 21; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[13] <= 0.5) { + if (features[16] <= 1.5) { + if (features[16] <= 0.5) { + classes[0] = 478; + classes[1] = 0; + } else { + if (features[17] <= 0.5) { + if (features[8] <= 3.0) { + if (features[7] <= 182.5) { + if (features[11] <= 3.5) { + if (features[1] <= 37.0) { + if (features[0] <= 4.0) { + if (features[7] <= 10.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + classes[0] = 28; + classes[1] = 0; + } + } else { + classes[0] = 44; + classes[1] = 0; + } + } else { + if (features[11] <= 4.5) { + if (features[0] <= 12.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[4] <= 91.0) { + if (features[7] <= 216.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[7] <= 201.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[3] <= 2.5) { + if (features[9] <= 12.5) { + if (features[14] <= 2.0) { + if (features[8] <= 1.5) { + if (features[4] <= 177.0) { + if (features[11] <= 0.5) { + if (features[2] <= 27.5) { + if (features[7] <= 50.5) { + if (features[14] <= 0.5) { + if (features[16] <= 2.5) { + if (features[2] <= 4.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 9; + classes[1] = 0; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[16] <= 2.5) { + if (features[9] <= 4.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[12] <= 51.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 20; + classes[1] = 0; + } + } + } else { + if (features[9] <= 5.5) { + if (features[0] <= 2.5) { + if (features[12] <= 10.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } else { + if (features[9] <= 6.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[1] <= 122.0) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[1] <= 170.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 17; + classes[1] = 0; + } + } else { + if (features[0] <= 12.5) { + if (features[8] <= 3.5) { + if (features[16] <= 2.5) { + if (features[9] <= 15.5) { + if (features[14] <= 0.5) { + if (features[0] <= 6.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[12] <= 6.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[9] <= 25.5) { + if (features[0] <= 2.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[0] <= 9.5) { + classes[0] = 0; + classes[1] = 19; + } else { + if (features[15] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[12] <= 16.0) { + if (features[4] <= 161.5) { + if (features[7] <= 132.0) { + if (features[2] <= 27.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } else { + if (features[2] <= 15.5) { + if (features[15] <= 3.5) { + if (features[12] <= 6.5) { + if (features[12] <= 5.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 17; + } + } else { + if (features[2] <= 8.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } else { + if (features[0] <= 2.5) { + if (features[7] <= 124.0) { + classes[0] = 0; + classes[1] = 11; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 57; + } + } + } + } else { + if (features[1] <= 38.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 15; + classes[1] = 0; + } + } + } else { + if (features[6] <= 0.5) { + if (features[1] <= 84.0) { + if (features[1] <= 35.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[9] <= 28.0) { + if (features[2] <= 19.5) { + if (features[9] <= 22.0) { + if (features[12] <= 15.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 0; + classes[1] = 16; + } + } else { + if (features[15] <= 4.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + if (features[17] <= 0.5) { + if (features[7] <= 182.5) { + if (features[7] <= 84.0) { + if (features[2] <= 27.5) { + if (features[15] <= 1.5) { + if (features[14] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + if (features[15] <= 9.5) { + classes[0] = 0; + classes[1] = 11; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[1] <= 107.5) { + if (features[11] <= 1.5) { + if (features[3] <= 1.5) { + if (features[9] <= 28.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[12] <= 40.0) { + if (features[8] <= 3.5) { + if (features[8] <= 2.0) { + if (features[12] <= 32.5) { + if (features[5] <= 1.0) { + if (features[11] <= 0.5) { + if (features[9] <= 55.5) { + classes[0] = 20; + classes[1] = 0; + } else { + if (features[8] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[2] <= 24.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[16] <= 2.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 13; + classes[1] = 0; + } + } + } + } else { + if (features[1] <= 181.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } + } else { + if (features[16] <= 2.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 15; + } + } + } + } + } else { + if (features[0] <= 19.0) { + if (features[8] <= 5.5) { + if (features[6] <= 0.5) { + if (features[7] <= 113.5) { + classes[0] = 0; + classes[1] = 31; + } else { + if (features[1] <= 59.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 19; + } + } + } else { + classes[0] = 0; + classes[1] = 13; + } + } else { + if (features[15] <= 11.0) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[12] <= 50.5) { + if (features[3] <= 3.5) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[7] <= 126.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[9] <= 82.5) { + if (features[8] <= 49.5) { + if (features[2] <= 40.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } + } + } else { + if (features[17] <= 0.5) { + if (features[0] <= 6.5) { + if (features[16] <= 4.5) { + if (features[0] <= 2.5) { + if (features[4] <= 78.0) { + if (features[7] <= 125.0) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[1] <= 118.0) { + if (features[2] <= 23.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[1] <= 236.0) { + classes[0] = 22; + classes[1] = 0; + } else { + if (features[8] <= 0.5) { + if (features[1] <= 241.0) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[6] <= 1.0) { + if (features[12] <= 9.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 13; + } + } else { + if (features[2] <= 38.0) { + if (features[12] <= 14.5) { + if (features[7] <= 464.0) { + if (features[15] <= 2.5) { + if (features[15] <= 1.5) { + if (features[7] <= 89.0) { + if (features[4] <= 59.5) { + if (features[14] <= 0.5) { + if (features[6] <= 0.5) { + classes[0] = 14; + classes[1] = 0; + } else { + if (features[6] <= 2.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + classes[0] = 34; + classes[1] = 0; + } + } else { + if (features[9] <= 24.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 15; + classes[1] = 0; + } + } else { + if (features[9] <= 53.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 102; + classes[1] = 0; + } + } else { + if (features[15] <= 7.5) { + if (features[16] <= 2.5) { + classes[0] = 41; + classes[1] = 0; + } else { + if (features[2] <= 50.5) { + classes[0] = 0; + classes[1] = 8; + } else { + if (features[13] <= 1.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 3.5) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } + } else { + if (features[17] <= 0.5) { + if (features[16] <= 1.5) { + if (features[3] <= 0.5) { + classes[0] = 178; + classes[1] = 0; + } else { + if (features[15] <= 5.0) { + if (features[8] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 11; + classes[1] = 0; + } + } + } else { + if (features[16] <= 4.5) { + if (features[1] <= 216.5) { + if (features[0] <= 3.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[9] <= 12.5) { + if (features[8] <= 0.5) { + if (features[0] <= 24.5) { + if (features[16] <= 2.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[2] <= 37.5) { + classes[0] = 0; + classes[1] = 21; + } else { + if (features[7] <= 234.0) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[8] <= 0.5) { + if (features[7] <= 285.0) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 18; + } + } + } else { + if (features[3] <= 0.5) { + if (features[9] <= 8.5) { + if (features[8] <= 0.5) { + if (features[0] <= 5.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[16] <= 3.5) { + if (features[14] <= 0.5) { + if (features[9] <= 5.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[0] <= 1.0) { + if (features[9] <= 20.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[16] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 139; + } + } + } + } else { + classes[0] = 0; + classes[1] = 32; + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_1(float features[]) { + int classes[2]; + + if (features[17] <= 0.5) { + if (features[2] <= 13.5) { + if (features[1] <= 56.5) { + if (features[16] <= 5.5) { + if (features[4] <= 12.0) { + if (features[7] <= 98.0) { + if (features[11] <= 0.5) { + if (features[1] <= 28.5) { + classes[0] = 215; + classes[1] = 0; + } else { + if (features[16] <= 4.0) { + if (features[8] <= 0.5) { + if (features[7] <= 6.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 40; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 41; + classes[1] = 0; + } + } else { + if (features[5] <= 0.5) { + if (features[9] <= 9.5) { + classes[0] = 11; + classes[1] = 0; + } else { + if (features[1] <= 41.0) { + if (features[0] <= 13.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[15] <= 2.5) { + if (features[15] <= 1.5) { + if (features[1] <= 41.0) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[14] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 23; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[16] <= 3.5) { + if (features[14] <= 0.5) { + if (features[16] <= 0.5) { + classes[0] = 185; + classes[1] = 0; + } else { + if (features[11] <= 0.5) { + if (features[0] <= 15.5) { + if (features[0] <= 9.5) { + if (features[1] <= 355.5) { + if (features[7] <= 38.5) { + if (features[1] <= 66.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 18; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[13] <= 1.0) { + if (features[15] <= 1.5) { + if (features[2] <= 8.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 30; + classes[1] = 0; + } + } else { + classes[0] = 26; + classes[1] = 0; + } + } + } else { + if (features[4] <= 602.5) { + if (features[1] <= 138.0) { + if (features[14] <= 8.5) { + if (features[2] <= 7.5) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[15] <= 6.0) { + if (features[0] <= 16.5) { + if (features[12] <= 7.5) { + if (features[7] <= 124.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + if (features[2] <= 9.5) { + classes[0] = 38; + classes[1] = 0; + } else { + if (features[11] <= 0.5) { + if (features[3] <= 0.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[2] <= 10.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + if (features[0] <= 19.5) { + if (features[9] <= 12.5) { + if (features[15] <= 0.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 22; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } + } else { + if (features[7] <= 110.5) { + if (features[4] <= 39.5) { + if (features[12] <= 2.5) { + if (features[15] <= 3.5) { + classes[0] = 89; + classes[1] = 0; + } else { + if (features[0] <= 5.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[2] <= 23.5) { + if (features[16] <= 1.5) { + if (features[7] <= 87.0) { + classes[0] = 71; + classes[1] = 0; + } else { + if (features[16] <= 0.5) { + classes[0] = 11; + classes[1] = 0; + } else { + if (features[0] <= 15.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[18] <= 0.5) { + if (features[1] <= 207.0) { + if (features[9] <= 17.0) { + if (features[0] <= 3.5) { + if (features[15] <= 4.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 20; + classes[1] = 0; + } + } else { + if (features[9] <= 36.5) { + classes[0] = 0; + classes[1] = 23; + } else { + if (features[2] <= 14.5) { + if (features[12] <= 19.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + if (features[9] <= 6.5) { + if (features[1] <= 61.0) { + if (features[1] <= 52.5) { + if (features[12] <= 8.0) { + classes[0] = 12; + classes[1] = 0; + } else { + if (features[2] <= 59.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 22; + classes[1] = 0; + } + } else { + if (features[1] <= 111.5) { + if (features[12] <= 3.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[15] <= 3.0) { + if (features[15] <= 0.5) { + if (features[12] <= 10.0) { + if (features[13] <= 3.5) { + if (features[16] <= 1.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 11; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[1] <= 92.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + classes[0] = 0; + classes[1] = 15; + } + } else { + if (features[15] <= 8.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } else { + if (features[14] <= 5.5) { + if (features[16] <= 1.5) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[15] <= 8.0) { + if (features[1] <= 158.0) { + if (features[14] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[15] <= 4.5) { + if (features[16] <= 1.5) { + if (features[9] <= 14.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[7] <= 56.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[12] <= 6.5) { + if (features[7] <= 35.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[16] <= 2.5) { + if (features[4] <= 476.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[5] <= 4.0) { + classes[0] = 0; + classes[1] = 60; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + if (features[0] <= 3.0) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[4] <= 85.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[3] <= 4.0) { + classes[0] = 8; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } + } else { + if (features[2] <= 35.5) { + if (features[4] <= 160.5) { + if (features[16] <= 1.5) { + if (features[8] <= 3.5) { + classes[0] = 297; + classes[1] = 0; + } else { + if (features[1] <= 112.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 14; + classes[1] = 0; + } + } + } else { + if (features[12] <= 0.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[18] <= 0.5) { + if (features[3] <= 1.5) { + if (features[2] <= 21.5) { + if (features[16] <= 3.5) { + classes[0] = 35; + classes[1] = 0; + } else { + if (features[12] <= 8.0) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[13] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[0] <= 5.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } else { + if (features[14] <= 2.5) { + if (features[4] <= 102.5) { + if (features[15] <= 0.5) { + if (features[2] <= 22.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[2] <= 31.0) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[16] <= 2.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } + } else { + if (features[12] <= 42.0) { + if (features[2] <= 24.5) { + if (features[4] <= 168.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[1] <= 478.0) { + if (features[7] <= 431.5) { + classes[0] = 19; + classes[1] = 0; + } else { + if (features[7] <= 718.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[9] <= 35.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[8] <= 49.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[0] <= 25.0) { + classes[0] = 12; + classes[1] = 0; + } else { + if (features[0] <= 30.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } + } + } else { + if (features[5] <= 0.5) { + if (features[16] <= 1.5) { + if (features[7] <= 291.5) { + if (features[7] <= 287.5) { + classes[0] = 63; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 115; + classes[1] = 0; + } + } else { + if (features[9] <= 5.5) { + classes[0] = 16; + classes[1] = 0; + } else { + if (features[13] <= 1.5) { + if (features[15] <= 0.5) { + if (features[0] <= 15.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[9] <= 49.0) { + if (features[2] <= 41.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 10; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[4] <= 562.0) { + if (features[4] <= 321.0) { + if (features[7] <= 245.5) { + if (features[12] <= 17.5) { + if (features[15] <= 2.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[1] <= 97.5) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } + } else { + if (features[12] <= 26.0) { + if (features[15] <= 0.5) { + if (features[7] <= 205.0) { + if (features[2] <= 42.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + if (features[2] <= 50.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[18] <= 0.5) { + if (features[0] <= 30.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 12; + } + } + } + } + } + } else { + if (features[8] <= 46.0) { + if (features[2] <= 36.0) { + if (features[16] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[0] <= 0.5) { + if (features[2] <= 12.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 139; + } + } + } else { + if (features[0] <= 1.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[0] <= 70.5) { + if (features[7] <= 51.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[1] <= 66.0) { + if (features[12] <= 6.5) { + classes[0] = 0; + classes[1] = 11; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[14] <= 0.5) { + if (features[3] <= 0.5) { + if (features[9] <= 13.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 9; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 55; + } + } + } + } else { + if (features[0] <= 255.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_2(float features[]) { + int classes[2]; + + if (features[14] <= 0.5) { + if (features[12] <= 2.5) { + if (features[16] <= 5.5) { + if (features[7] <= 55.5) { + if (features[0] <= 3.5) { + classes[0] = 230; + classes[1] = 0; + } else { + if (features[16] <= 2.5) { + classes[0] = 47; + classes[1] = 0; + } else { + if (features[11] <= 1.0) { + if (features[2] <= 9.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 13; + classes[1] = 0; + } + } + } + } else { + if (features[0] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[4] <= 207.0) { + if (features[16] <= 1.5) { + classes[0] = 64; + classes[1] = 0; + } else { + if (features[15] <= 0.5) { + if (features[2] <= 17.0) { + classes[0] = 13; + classes[1] = 0; + } else { + if (features[11] <= 0.5) { + if (features[2] <= 28.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[9] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[17] <= 0.5) { + if (features[5] <= 0.5) { + if (features[3] <= 1.5) { + if (features[3] <= 0.5) { + if (features[7] <= 90.5) { + if (features[2] <= 24.5) { + if (features[9] <= 22.0) { + if (features[2] <= 1.5) { + if (features[2] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[0] <= 9.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[12] <= 10.5) { + classes[0] = 92; + classes[1] = 0; + } else { + if (features[16] <= 5.0) { + if (features[15] <= 0.5) { + if (features[6] <= 0.5) { + if (features[9] <= 18.5) { + if (features[16] <= 0.5) { + classes[0] = 15; + classes[1] = 0; + } else { + if (features[1] <= 352.0) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[7] <= 77.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 29; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[2] <= 19.0) { + if (features[0] <= 9.5) { + if (features[7] <= 45.0) { + if (features[2] <= 7.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[2] <= 10.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[15] <= 8.5) { + if (features[16] <= 2.5) { + classes[0] = 23; + classes[1] = 0; + } else { + if (features[1] <= 115.5) { + classes[0] = 0; + classes[1] = 9; + } else { + if (features[9] <= 14.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[1] <= 119.5) { + if (features[7] <= 561.0) { + if (features[15] <= 14.5) { + if (features[11] <= 0.5) { + if (features[1] <= 75.0) { + classes[0] = 37; + classes[1] = 0; + } else { + if (features[15] <= 0.5) { + if (features[16] <= 1.5) { + if (features[13] <= 0.5) { + if (features[7] <= 190.0) { + classes[0] = 16; + classes[1] = 0; + } else { + if (features[2] <= 15.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[2] <= 9.5) { + if (features[12] <= 28.5) { + classes[0] = 10; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 15; + classes[1] = 0; + } + } + } + } else { + classes[0] = 22; + classes[1] = 0; + } + } else { + if (features[0] <= 33.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[9] <= 11.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[0] <= 4.5) { + if (features[12] <= 11.0) { + if (features[7] <= 261.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[9] <= 7.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 26; + classes[1] = 0; + } + } else { + if (features[15] <= 17.0) { + if (features[0] <= 23.5) { + if (features[16] <= 2.5) { + classes[0] = 83; + classes[1] = 0; + } else { + if (features[12] <= 53.5) { + classes[0] = 19; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 230; + classes[1] = 0; + } + } else { + if (features[1] <= 165.0) { + if (features[7] <= 325.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 13; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[4] <= 97.5) { + if (features[16] <= 0.5) { + classes[0] = 18; + classes[1] = 0; + } else { + if (features[9] <= 18.5) { + if (features[11] <= 0.5) { + if (features[7] <= 23.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[4] <= 90.5) { + classes[0] = 11; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[13] <= 4.0) { + if (features[6] <= 0.5) { + if (features[2] <= 39.0) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 18; + classes[1] = 0; + } + } + } else { + if (features[16] <= 2.5) { + if (features[1] <= 92.0) { + if (features[15] <= 14.0) { + if (features[7] <= 43.5) { + if (features[9] <= 11.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + if (features[2] <= 17.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[0] <= 12.0) { + if (features[12] <= 10.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[11] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 17; + classes[1] = 0; + } + } + } else { + if (features[2] <= 29.0) { + if (features[15] <= 4.0) { + classes[0] = 0; + classes[1] = 32; + } else { + if (features[12] <= 30.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[9] <= 43.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[12] <= 20.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[12] <= 15.0) { + if (features[2] <= 6.5) { + if (features[2] <= 2.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 31; + classes[1] = 0; + } + } else { + if (features[12] <= 37.0) { + if (features[2] <= 29.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 20; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[9] <= 1.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[8] <= 31.5) { + classes[0] = 0; + classes[1] = 56; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[12] <= 38.5) { + if (features[9] <= 6.5) { + if (features[9] <= 5.5) { + if (features[12] <= 2.5) { + if (features[14] <= 2.0) { + if (features[1] <= 42.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 70; + classes[1] = 0; + } + } else { + if (features[7] <= 242.5) { + if (features[11] <= 0.5) { + if (features[14] <= 2.5) { + if (features[2] <= 17.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 154; + classes[1] = 0; + } else { + if (features[17] <= 0.5) { + if (features[1] <= 48.5) { + if (features[2] <= 19.5) { + if (features[4] <= 146.0) { + if (features[16] <= 3.0) { + classes[0] = 22; + classes[1] = 0; + } else { + if (features[0] <= 1.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[2] <= 9.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[0] <= 3.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + if (features[2] <= 42.5) { + if (features[7] <= 52.0) { + if (features[0] <= 9.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[9] <= 201.0) { + if (features[11] <= 1.5) { + if (features[2] <= 63.0) { + if (features[14] <= 9.5) { + if (features[2] <= 5.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[6] <= 13.0) { + if (features[7] <= 203.0) { + if (features[4] <= 34.0) { + if (features[16] <= 1.5) { + if (features[12] <= 8.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[7] <= 47.0) { + if (features[7] <= 38.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[2] <= 31.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[12] <= 8.5) { + classes[0] = 0; + classes[1] = 23; + } else { + if (features[14] <= 2.0) { + if (features[2] <= 42.5) { + if (features[8] <= 1.5) { + if (features[0] <= 5.5) { + if (features[5] <= 0.5) { + if (features[1] <= 92.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 27; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 15; + } + } + } + } + } else { + if (features[9] <= 21.5) { + if (features[2] <= 26.0) { + classes[0] = 0; + classes[1] = 18; + } else { + if (features[15] <= 2.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 34; + } + } + } else { + if (features[1] <= 115.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[4] <= 189.5) { + classes[0] = 0; + classes[1] = 12; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[4] <= 39.0) { + if (features[12] <= 21.5) { + classes[0] = 11; + classes[1] = 0; + } else { + if (features[16] <= 1.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[4] <= 88.5) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + if (features[15] <= 0.5) { + classes[0] = 0; + classes[1] = 55; + } else { + if (features[5] <= 0.5) { + if (features[18] <= 0.5) { + if (features[0] <= 29.5) { + if (features[1] <= 65.0) { + if (features[7] <= 80.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 25; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[0] <= 0.5) { + if (features[15] <= 1.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[12] <= 28.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[9] <= 22.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 86; + } + } + } else { + classes[0] = 0; + classes[1] = 22; + } + } + } + } + } + } else { + if (features[17] <= 0.5) { + if (features[14] <= 3.5) { + if (features[5] <= 0.5) { + if (features[0] <= 8.5) { + if (features[12] <= 79.5) { + if (features[7] <= 308.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 21; + classes[1] = 0; + } + } else { + if (features[2] <= 16.5) { + classes[0] = 0; + classes[1] = 9; + } else { + classes[0] = 16; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 57; + classes[1] = 0; + } + } else { + if (features[15] <= 0.5) { + if (features[9] <= 27.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_3(float features[]) { + int classes[2]; + + if (features[14] <= 0.5) { + if (features[2] <= 14.5) { + if (features[9] <= 13.5) { + if (features[16] <= 5.5) { + if (features[7] <= 4.5) { + classes[0] = 158; + classes[1] = 0; + } else { + if (features[8] <= 1.5) { + if (features[4] <= 289.0) { + if (features[7] <= 5.5) { + if (features[12] <= 2.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[7] <= 47.0) { + if (features[7] <= 45.5) { + if (features[9] <= 8.5) { + if (features[2] <= 1.5) { + if (features[6] <= 0.5) { + if (features[2] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[13] <= 0.5) { + if (features[0] <= 2.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 91; + classes[1] = 0; + } + } else { + if (features[1] <= 20.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 155; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[1] <= 37.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } + } else { + if (features[1] <= 13.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[3] <= 0.5) { + if (features[8] <= 0.5) { + if (features[16] <= 3.5) { + if (features[6] <= 0.5) { + if (features[0] <= 13.5) { + if (features[2] <= 8.5) { + classes[0] = 16; + classes[1] = 0; + } else { + if (features[12] <= 6.5) { + if (features[1] <= 28.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + if (features[1] <= 108.5) { + if (features[7] <= 119.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } + } + } else { + classes[0] = 89; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[7] <= 14.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 8; + } + } + } else { + if (features[7] <= 33.5) { + if (features[12] <= 7.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[2] <= 11.5) { + if (features[4] <= 95.0) { + if (features[15] <= 1.0) { + if (features[2] <= 10.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[0] <= 7.0) { + if (features[16] <= 2.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } else { + if (features[15] <= 4.0) { + if (features[3] <= 1.5) { + if (features[7] <= 62.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 11; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[0] <= 17.5) { + if (features[7] <= 19.5) { + classes[0] = 48; + classes[1] = 0; + } else { + if (features[7] <= 245.0) { + if (features[0] <= 10.5) { + if (features[17] <= 0.5) { + if (features[12] <= 24.0) { + if (features[16] <= 1.5) { + classes[0] = 64; + classes[1] = 0; + } else { + if (features[4] <= 9.5) { + if (features[2] <= 25.5) { + if (features[15] <= 0.5) { + if (features[16] <= 3.5) { + if (features[7] <= 46.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } else { + classes[0] = 22; + classes[1] = 0; + } + } else { + if (features[0] <= 3.5) { + if (features[2] <= 32.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 12; + } + } + } else { + if (features[12] <= 6.5) { + if (features[7] <= 51.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 19; + } + } + } + } else { + if (features[16] <= 2.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 14; + } + } + } else { + classes[0] = 0; + classes[1] = 28; + } + } else { + if (features[16] <= 1.5) { + classes[0] = 58; + classes[1] = 0; + } else { + if (features[17] <= 0.5) { + if (features[13] <= 1.5) { + if (features[16] <= 3.5) { + if (features[15] <= 0.5) { + if (features[9] <= 16.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[1] <= 88.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } else { + if (features[7] <= 133.5) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[9] <= 6.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 12; + } + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } + } else { + if (features[9] <= 276.5) { + if (features[2] <= 25.5) { + if (features[15] <= 5.5) { + if (features[1] <= 97.0) { + if (features[1] <= 67.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[7] <= 458.5) { + if (features[7] <= 323.5) { + if (features[4] <= 38.5) { + if (features[9] <= 14.5) { + if (features[12] <= 8.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[4] <= 92.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[5] <= 0.5) { + if (features[4] <= 180.5) { + classes[0] = 35; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + if (features[4] <= 74.0) { + if (features[5] <= 0.5) { + if (features[1] <= 106.5) { + if (features[11] <= 1.5) { + if (features[12] <= 5.5) { + if (features[0] <= 43.0) { + if (features[12] <= 3.5) { + classes[0] = 12; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[1] <= 86.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 21; + classes[1] = 0; + } + } else { + if (features[2] <= 30.0) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } else { + if (features[7] <= 92.5) { + if (features[1] <= 158.5) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[1] <= 217.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[18] <= 0.5) { + classes[0] = 176; + classes[1] = 0; + } else { + if (features[15] <= 15.5) { + if (features[12] <= 46.0) { + classes[0] = 39; + classes[1] = 0; + } else { + if (features[9] <= 31.0) { + if (features[11] <= 1.0) { + if (features[0] <= 81.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[13] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[9] <= 22.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } + } + } else { + if (features[7] <= 415.0) { + if (features[2] <= 44.5) { + classes[0] = 15; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[1] <= 370.0) { + classes[0] = 0; + classes[1] = 8; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 3.5) { + if (features[13] <= 0.5) { + if (features[12] <= 17.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[7] <= 121.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[9] <= 69.0) { + if (features[8] <= 0.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[0] <= 19.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[4] <= 503.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[15] <= 1.5) { + if (features[6] <= 10.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } + } + } else { + classes[0] = 17; + classes[1] = 0; + } + } else { + if (features[7] <= 260.0) { + if (features[1] <= 384.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 15; + } + } + } + } + } + } else { + if (features[9] <= 7.5) { + if (features[9] <= 4.5) { + classes[0] = 76; + classes[1] = 0; + } else { + if (features[7] <= 163.0) { + if (features[12] <= 12.5) { + if (features[2] <= 29.5) { + if (features[1] <= 91.5) { + classes[0] = 12; + classes[1] = 0; + } else { + if (features[1] <= 123.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } + } else { + if (features[17] <= 0.5) { + if (features[16] <= 1.5) { + if (features[16] <= 0.5) { + classes[0] = 132; + classes[1] = 0; + } else { + if (features[2] <= 33.5) { + classes[0] = 25; + classes[1] = 0; + } else { + if (features[15] <= 3.0) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } else { + if (features[7] <= 118.0) { + if (features[0] <= 4.5) { + if (features[4] <= 90.0) { + if (features[1] <= 155.5) { + if (features[15] <= 2.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[2] <= 20.0) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + if (features[4] <= 279.0) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[12] <= 4.5) { + if (features[0] <= 8.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + if (features[12] <= 30.5) { + if (features[12] <= 10.5) { + if (features[14] <= 4.5) { + if (features[0] <= 5.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 27; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 66; + } + } else { + if (features[0] <= 21.5) { + classes[0] = 0; + classes[1] = 17; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } else { + if (features[2] <= 31.5) { + if (features[4] <= 91.0) { + if (features[3] <= 0.5) { + if (features[12] <= 46.5) { + if (features[1] <= 95.5) { + if (features[9] <= 26.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[11] <= 0.5) { + if (features[7] <= 144.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[18] <= 0.5) { + if (features[0] <= 11.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } else { + if (features[16] <= 3.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[1] <= 74.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 13; + } + } + } else { + if (features[0] <= 6.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[4] <= 687.0) { + if (features[2] <= 15.5) { + if (features[4] <= 593.0) { + classes[0] = 26; + classes[1] = 0; + } else { + if (features[7] <= 217.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[0] <= 15.5) { + if (features[7] <= 213.0) { + if (features[16] <= 5.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[0] <= 39.5) { + classes[0] = 14; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } else { + if (features[2] <= 54.5) { + if (features[14] <= 14.0) { + classes[0] = 0; + classes[1] = 17; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[3] <= 5.5) { + if (features[12] <= 61.5) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[16] <= 3.5) { + if (features[0] <= 72.0) { + if (features[12] <= 28.0) { + if (features[0] <= 11.5) { + if (features[15] <= 1.5) { + if (features[15] <= 0.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 18; + } + } else { + classes[0] = 0; + classes[1] = 86; + } + } else { + if (features[12] <= 51.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[11] <= 1.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 89; + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_4(float features[]) { + int classes[2]; + + if (features[1] <= 24.5) { + if (features[11] <= 8.5) { + if (features[4] <= 155.0) { + classes[0] = 261; + classes[1] = 0; + } else { + if (features[4] <= 196.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[14] <= 0.5) { + if (features[4] <= 9.5) { + if (features[1] <= 98.5) { + if (features[11] <= 0.5) { + if (features[9] <= 16.5) { + if (features[16] <= 1.5) { + classes[0] = 127; + classes[1] = 0; + } else { + if (features[2] <= 36.5) { + if (features[7] <= 78.5) { + if (features[0] <= 4.5) { + if (features[7] <= 30.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 22; + classes[1] = 0; + } + } else { + if (features[15] <= 0.5) { + if (features[9] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[6] <= 0.5) { + classes[0] = 0; + classes[1] = 9; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + if (features[16] <= 2.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[1] <= 59.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + if (features[17] <= 0.5) { + if (features[16] <= 2.5) { + if (features[6] <= 0.5) { + if (features[16] <= 0.5) { + classes[0] = 16; + classes[1] = 0; + } else { + if (features[15] <= 0.5) { + if (features[1] <= 30.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[2] <= 11.5) { + if (features[1] <= 45.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[8] <= 2.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 21; + } + } + } else { + classes[0] = 0; + classes[1] = 26; + } + } + } else { + if (features[7] <= 513.0) { + classes[0] = 65; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[16] <= 3.5) { + if (features[2] <= 71.5) { + if (features[12] <= 56.0) { + if (features[17] <= 0.5) { + if (features[9] <= 254.0) { + if (features[9] <= 48.5) { + if (features[16] <= 2.5) { + classes[0] = 389; + classes[1] = 0; + } else { + if (features[12] <= 8.5) { + classes[0] = 21; + classes[1] = 0; + } else { + if (features[15] <= 0.5) { + if (features[1] <= 157.0) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[12] <= 19.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } else { + if (features[8] <= 0.5) { + classes[0] = 52; + classes[1] = 0; + } else { + if (features[12] <= 12.0) { + if (features[7] <= 84.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } + } else { + if (features[12] <= 4.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + if (features[18] <= 0.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[8] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[1] <= 386.0) { + if (features[12] <= 57.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[6] <= 0.5) { + if (features[2] <= 12.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 39; + classes[1] = 0; + } + } + } else { + if (features[7] <= 231.5) { + if (features[2] <= 80.0) { + classes[0] = 0; + classes[1] = 8; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[13] <= 1.0) { + if (features[16] <= 1.5) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } + } else { + if (features[9] <= 1.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[5] <= 0.5) { + if (features[1] <= 180.0) { + if (features[13] <= 1.5) { + if (features[0] <= 28.5) { + if (features[1] <= 119.5) { + classes[0] = 0; + classes[1] = 8; + } else { + if (features[18] <= 0.5) { + if (features[16] <= 4.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[2] <= 64.0) { + if (features[2] <= 17.5) { + if (features[9] <= 13.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } + } + } + } else { + if (features[1] <= 140.0) { + if (features[2] <= 28.5) { + if (features[16] <= 1.5) { + if (features[7] <= 203.0) { + if (features[7] <= 53.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[9] <= 110.5) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[2] <= 20.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[7] <= 32.5) { + if (features[16] <= 2.5) { + if (features[2] <= 16.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[6] <= 0.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[3] <= 7.0) { + if (features[5] <= 3.0) { + if (features[16] <= 2.5) { + if (features[9] <= 15.0) { + if (features[9] <= 7.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } else { + classes[0] = 0; + classes[1] = 34; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[0] <= 8.0) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[2] <= 31.5) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[2] <= 33.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[7] <= 166.5) { + if (features[13] <= 0.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[17] <= 0.5) { + if (features[8] <= 66.0) { + if (features[5] <= 0.5) { + if (features[16] <= 4.5) { + if (features[7] <= 42.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[7] <= 156.5) { + if (features[4] <= 233.0) { + classes[0] = 16; + classes[1] = 0; + } else { + if (features[15] <= 2.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 45; + classes[1] = 0; + } + } + } else { + if (features[9] <= 37.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[7] <= 589.5) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } + } else { + if (features[0] <= 21.5) { + if (features[17] <= 0.5) { + if (features[16] <= 1.5) { + if (features[9] <= 21.5) { + if (features[2] <= 15.5) { + if (features[2] <= 14.5) { + classes[0] = 30; + classes[1] = 0; + } else { + if (features[9] <= 9.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 42; + classes[1] = 0; + } + } else { + if (features[2] <= 36.0) { + classes[0] = 20; + classes[1] = 0; + } else { + if (features[0] <= 10.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } else { + if (features[7] <= 193.5) { + if (features[2] <= 13.5) { + if (features[18] <= 0.5) { + if (features[14] <= 1.5) { + if (features[3] <= 3.5) { + if (features[15] <= 0.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[9] <= 11.0) { + if (features[9] <= 7.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 23; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[12] <= 3.5) { + if (features[14] <= 6.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[8] <= 0.5) { + classes[0] = 0; + classes[1] = 9; + } else { + if (features[14] <= 8.5) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 13; + } + } else { + if (features[7] <= 26.5) { + if (features[3] <= 1.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[0] <= 4.5) { + if (features[12] <= 4.5) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[1] <= 155.5) { + if (features[2] <= 22.5) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[4] <= 470.5) { + if (features[0] <= 2.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[12] <= 4.5) { + if (features[9] <= 22.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[2] <= 50.5) { + if (features[4] <= 34.0) { + if (features[2] <= 34.5) { + if (features[12] <= 44.0) { + classes[0] = 0; + classes[1] = 33; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[7] <= 70.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } else { + classes[0] = 0; + classes[1] = 37; + } + } else { + if (features[8] <= 0.5) { + if (features[0] <= 11.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } + } + } + } else { + if (features[9] <= 41.5) { + if (features[7] <= 257.5) { + classes[0] = 19; + classes[1] = 0; + } else { + if (features[12] <= 9.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[4] <= 39.0) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[7] <= 304.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } + } else { + if (features[7] <= 255.0) { + if (features[2] <= 73.0) { + classes[0] = 0; + classes[1] = 138; + } else { + if (features[2] <= 75.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[12] <= 41.0) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[17] <= 0.5) { + if (features[16] <= 1.5) { + classes[0] = 161; + classes[1] = 0; + } else { + if (features[12] <= 38.0) { + if (features[15] <= 6.5) { + if (features[4] <= 12.0) { + if (features[14] <= 1.5) { + if (features[9] <= 119.0) { + if (features[18] <= 0.5) { + if (features[9] <= 39.5) { + classes[0] = 0; + classes[1] = 7; + } else { + if (features[1] <= 126.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[1] <= 140.5) { + if (features[18] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 19; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 15; + classes[1] = 0; + } + } + } else { + if (features[2] <= 14.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[15] <= 8.5) { + if (features[7] <= 400.0) { + classes[0] = 0; + classes[1] = 41; + } else { + if (features[6] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[2] <= 50.5) { + classes[0] = 0; + classes[1] = 10; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_5(float features[]) { + int classes[2]; + + if (features[4] <= 17.5) { + if (features[14] <= 0.5) { + if (features[2] <= 71.5) { + if (features[12] <= 2.5) { + if (features[16] <= 5.5) { + if (features[7] <= 115.5) { + classes[0] = 320; + classes[1] = 0; + } else { + if (features[13] <= 0.5) { + if (features[16] <= 1.5) { + classes[0] = 31; + classes[1] = 0; + } else { + if (features[1] <= 94.0) { + if (features[7] <= 145.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[12] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[16] <= 2.5) { + if (features[13] <= 0.5) { + if (features[9] <= 11.5) { + if (features[11] <= 0.5) { + if (features[8] <= 0.5) { + if (features[7] <= 6.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[16] <= 1.5) { + if (features[16] <= 0.5) { + classes[0] = 142; + classes[1] = 0; + } else { + if (features[7] <= 51.0) { + if (features[6] <= 0.5) { + if (features[0] <= 9.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[12] <= 8.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 25; + classes[1] = 0; + } + } + } else { + if (features[0] <= 6.0) { + if (features[1] <= 71.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[7] <= 159.0) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[12] <= 5.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 17; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 24; + classes[1] = 0; + } + } else { + classes[0] = 63; + classes[1] = 0; + } + } else { + if (features[1] <= 75.0) { + if (features[2] <= 27.0) { + if (features[7] <= 105.5) { + if (features[0] <= 8.5) { + if (features[0] <= 5.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[11] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 12; + classes[1] = 0; + } + } else { + if (features[1] <= 73.0) { + if (features[0] <= 24.0) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[1] <= 44.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[15] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } else { + if (features[5] <= 0.5) { + if (features[7] <= 128.0) { + if (features[9] <= 17.5) { + classes[0] = 15; + classes[1] = 0; + } else { + if (features[7] <= 110.0) { + classes[0] = 21; + classes[1] = 0; + } else { + if (features[1] <= 117.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 1.5) { + classes[0] = 147; + classes[1] = 0; + } else { + if (features[1] <= 113.5) { + if (features[2] <= 26.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } + } else { + classes[0] = 141; + classes[1] = 0; + } + } else { + if (features[16] <= 3.5) { + if (features[13] <= 0.5) { + if (features[7] <= 428.0) { + if (features[2] <= 16.5) { + if (features[1] <= 53.5) { + if (features[7] <= 15.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[9] <= 8.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[12] <= 8.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[9] <= 13.5) { + if (features[15] <= 13.5) { + if (features[5] <= 0.5) { + if (features[17] <= 0.5) { + if (features[2] <= 25.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 16; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 18; + classes[1] = 0; + } + } else { + if (features[18] <= 0.5) { + if (features[7] <= 100.5) { + if (features[11] <= 3.5) { + if (features[0] <= 12.5) { + classes[0] = 0; + classes[1] = 22; + } else { + if (features[7] <= 70.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[5] <= 0.5) { + if (features[2] <= 48.5) { + if (features[9] <= 13.5) { + classes[0] = 11; + classes[1] = 0; + } else { + if (features[1] <= 172.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + if (features[12] <= 26.5) { + classes[0] = 0; + classes[1] = 11; + } else { + if (features[7] <= 220.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } + } + } else { + if (features[7] <= 263.5) { + if (features[12] <= 8.0) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[1] <= 132.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 14; + } + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } else { + if (features[9] <= 7.5) { + if (features[14] <= 2.5) { + if (features[2] <= 20.5) { + classes[0] = 20; + classes[1] = 0; + } else { + if (features[9] <= 4.5) { + if (features[1] <= 94.0) { + if (features[11] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } else { + if (features[13] <= 0.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 57; + classes[1] = 0; + } + } else { + if (features[15] <= 17.5) { + if (features[17] <= 0.5) { + if (features[14] <= 7.5) { + if (features[7] <= 113.5) { + if (features[8] <= 1.5) { + if (features[7] <= 83.5) { + if (features[2] <= 5.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[16] <= 1.5) { + if (features[18] <= 0.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[9] <= 13.5) { + if (features[1] <= 62.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[0] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[6] <= 12.5) { + if (features[1] <= 107.0) { + if (features[0] <= 13.5) { + classes[0] = 0; + classes[1] = 8; + } else { + if (features[2] <= 6.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[2] <= 20.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 0; + classes[1] = 11; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[15] <= 4.5) { + if (features[7] <= 90.5) { + if (features[15] <= 3.0) { + classes[0] = 0; + classes[1] = 10; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 29; + } + } else { + if (features[16] <= 3.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[0] <= 10.5) { + if (features[0] <= 4.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[2] <= 9.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } else { + if (features[5] <= 0.5) { + if (features[9] <= 43.5) { + if (features[15] <= 3.5) { + if (features[15] <= 0.5) { + if (features[2] <= 32.0) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[16] <= 0.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[16] <= 3.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 19; + classes[1] = 0; + } + } else { + if (features[14] <= 6.5) { + if (features[1] <= 220.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[12] <= 11.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[9] <= 201.0) { + if (features[16] <= 1.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[7] <= 121.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 9; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + if (features[2] <= 30.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } + } else { + if (features[2] <= 8.0) { + if (features[14] <= 15.5) { + if (features[7] <= 66.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[12] <= 24.0) { + if (features[1] <= 109.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[18] <= 0.5) { + if (features[2] <= 20.5) { + classes[0] = 32; + classes[1] = 0; + } else { + if (features[16] <= 3.5) { + classes[0] = 17; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[7] <= 109.0) { + if (features[16] <= 2.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 23; + classes[1] = 0; + } + } + } + } + } else { + if (features[12] <= 27.5) { + if (features[12] <= 2.5) { + if (features[1] <= 75.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[12] <= 26.5) { + if (features[1] <= 86.0) { + if (features[2] <= 66.5) { + classes[0] = 0; + classes[1] = 28; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 70; + } + } else { + if (features[7] <= 321.5) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[14] <= 3.0) { + if (features[16] <= 4.5) { + if (features[16] <= 3.5) { + if (features[2] <= 46.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } else { + if (features[1] <= 191.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 13; + } + } + } + } + } else { + if (features[16] <= 1.0) { + classes[0] = 24; + classes[1] = 0; + } else { + if (features[14] <= 5.5) { + if (features[0] <= 13.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } + } + } else { + if (features[18] <= 0.5) { + if (features[7] <= 123.0) { + if (features[9] <= 17.5) { + if (features[2] <= 13.5) { + if (features[4] <= 165.5) { + if (features[7] <= 27.5) { + if (features[16] <= 1.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[6] <= 0.5) { + if (features[14] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 32; + classes[1] = 0; + } + } else { + if (features[15] <= 3.5) { + if (features[3] <= 1.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[2] <= 2.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + if (features[14] <= 0.5) { + if (features[7] <= 90.0) { + if (features[0] <= 7.5) { + if (features[2] <= 16.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + if (features[9] <= 15.5) { + classes[0] = 12; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[12] <= 7.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 9; + } + } + } else { + if (features[1] <= 32.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 9; + } + } + } + } else { + if (features[0] <= 5.5) { + if (features[2] <= 9.5) { + if (features[7] <= 25.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[7] <= 63.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[1] <= 29.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[0] <= 3.0) { + classes[0] = 0; + classes[1] = 8; + } else { + if (features[12] <= 6.5) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[2] <= 50.0) { + if (features[16] <= 1.5) { + if (features[12] <= 11.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 7; + } + } else { + classes[0] = 0; + classes[1] = 80; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } + } else { + if (features[17] <= 0.5) { + if (features[1] <= 93.5) { + if (features[16] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[12] <= 6.5) { + if (features[2] <= 8.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } else { + if (features[12] <= 91.5) { + if (features[16] <= 1.5) { + classes[0] = 39; + classes[1] = 0; + } else { + if (features[3] <= 1.5) { + if (features[5] <= 0.5) { + if (features[13] <= 0.5) { + if (features[9] <= 14.0) { + if (features[0] <= 8.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + classes[0] = 19; + classes[1] = 0; + } + } else { + if (features[0] <= 11.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[8] <= 0.5) { + if (features[13] <= 0.5) { + if (features[15] <= 0.5) { + if (features[4] <= 588.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[5] <= 0.5) { + if (features[14] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } + } else { + if (features[11] <= 1.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[4] <= 688.0) { + if (features[14] <= 3.0) { + if (features[16] <= 3.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + if (features[2] <= 28.5) { + if (features[1] <= 459.5) { + classes[0] = 0; + classes[1] = 10; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[12] <= 37.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } + } + } else { + classes[0] = 23; + classes[1] = 0; + } + } + } else { + if (features[1] <= 67.5) { + if (features[12] <= 8.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } + } else { + if (features[11] <= 0.5) { + if (features[16] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 53; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_6(float features[]) { + int classes[2]; + + if (features[3] <= 1.5) { + if (features[16] <= 1.5) { + if (features[1] <= 107.5) { + if (features[16] <= 0.5) { + classes[0] = 390; + classes[1] = 0; + } else { + if (features[17] <= 0.5) { + if (features[3] <= 0.5) { + if (features[7] <= 182.5) { + if (features[7] <= 6.0) { + if (features[1] <= 32.0) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[9] <= 11.5) { + classes[0] = 96; + classes[1] = 0; + } else { + if (features[1] <= 76.0) { + classes[0] = 14; + classes[1] = 0; + } else { + if (features[14] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[2] <= 17.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[12] <= 11.0) { + if (features[4] <= 76.5) { + if (features[7] <= 61.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 15; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } else { + classes[0] = 0; + classes[1] = 26; + } + } + } else { + classes[0] = 627; + classes[1] = 0; + } + } else { + if (features[15] <= 0.5) { + if (features[9] <= 7.5) { + if (features[11] <= 1.5) { + if (features[0] <= 57.0) { + if (features[9] <= 0.5) { + classes[0] = 29; + classes[1] = 0; + } else { + if (features[16] <= 2.5) { + if (features[2] <= 38.5) { + if (features[1] <= 78.5) { + if (features[7] <= 101.0) { + if (features[9] <= 2.5) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[0] <= 4.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[2] <= 10.0) { + if (features[1] <= 112.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[6] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 15; + classes[1] = 0; + } + } + } else { + if (features[2] <= 42.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[7] <= 80.0) { + classes[0] = 18; + classes[1] = 0; + } else { + if (features[12] <= 7.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } + } + } else { + if (features[16] <= 3.5) { + if (features[2] <= 22.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + classes[0] = 20; + classes[1] = 0; + } + } else { + if (features[8] <= 1.5) { + if (features[1] <= 411.5) { + if (features[13] <= 0.5) { + if (features[16] <= 2.5) { + if (features[2] <= 49.0) { + if (features[11] <= 4.5) { + if (features[1] <= 111.5) { + if (features[17] <= 0.5) { + if (features[9] <= 11.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[7] <= 81.5) { + if (features[9] <= 19.0) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[0] <= 18.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[8] <= 0.5) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } else { + if (features[1] <= 148.0) { + classes[0] = 0; + classes[1] = 10; + } else { + if (features[3] <= 0.5) { + if (features[9] <= 82.5) { + if (features[18] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[9] <= 19.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + if (features[6] <= 4.0) { + if (features[12] <= 11.5) { + if (features[12] <= 10.5) { + if (features[5] <= 0.5) { + if (features[0] <= 28.5) { + if (features[0] <= 8.5) { + if (features[9] <= 14.0) { + if (features[14] <= 6.5) { + if (features[0] <= 5.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 19; + } + } else { + classes[0] = 0; + classes[1] = 26; + } + } else { + if (features[18] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[11] <= 6.0) { + classes[0] = 0; + classes[1] = 40; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[17] <= 0.5) { + if (features[16] <= 4.5) { + classes[0] = 19; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 11; + classes[1] = 0; + } + } else { + if (features[0] <= 23.0) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[13] <= 0.5) { + if (features[12] <= 10.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } + } else { + if (features[1] <= 30.5) { + if (features[12] <= 4.0) { + classes[0] = 11; + classes[1] = 0; + } else { + if (features[7] <= 36.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + if (features[12] <= 47.5) { + if (features[17] <= 0.5) { + if (features[4] <= 97.5) { + if (features[11] <= 2.5) { + if (features[13] <= 1.5) { + if (features[0] <= 18.5) { + if (features[1] <= 160.0) { + if (features[9] <= 6.5) { + if (features[7] <= 84.5) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[1] <= 64.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + if (features[9] <= 82.5) { + if (features[0] <= 15.5) { + if (features[13] <= 0.5) { + if (features[15] <= 15.0) { + if (features[7] <= 15.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[11] <= 0.5) { + if (features[15] <= 7.0) { + if (features[1] <= 35.0) { + if (features[12] <= 4.5) { + if (features[1] <= 33.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + if (features[7] <= 143.5) { + classes[0] = 0; + classes[1] = 40; + } else { + if (features[9] <= 19.5) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[7] <= 101.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[9] <= 20.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[9] <= 32.0) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[1] <= 107.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[8] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[7] <= 88.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[7] <= 154.0) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[15] <= 2.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[12] <= 17.5) { + if (features[3] <= 0.5) { + if (features[7] <= 261.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 33; + } + } + } else { + if (features[5] <= 0.5) { + if (features[0] <= 52.0) { + if (features[13] <= 0.5) { + if (features[16] <= 6.5) { + if (features[7] <= 122.0) { + if (features[8] <= 1.5) { + if (features[0] <= 31.5) { + classes[0] = 8; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 13; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[9] <= 8.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + classes[0] = 11; + classes[1] = 0; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + classes[0] = 12; + classes[1] = 0; + } + } else { + if (features[1] <= 172.5) { + classes[0] = 0; + classes[1] = 87; + } else { + if (features[18] <= 0.5) { + if (features[14] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[3] <= 0.5) { + if (features[0] <= 1.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 43; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } + } else { + if (features[9] <= 48.0) { + if (features[14] <= 2.5) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[9] <= 12.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 14; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[0] <= 56.5) { + if (features[12] <= 42.0) { + if (features[7] <= 45.5) { + if (features[0] <= 11.5) { + if (features[11] <= 0.5) { + if (features[4] <= 624.5) { + if (features[16] <= 3.5) { + if (features[12] <= 28.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + if (features[16] <= 2.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[17] <= 0.5) { + if (features[2] <= 11.5) { + if (features[3] <= 2.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[1] <= 346.0) { + if (features[8] <= 1.0) { + if (features[7] <= 153.5) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[2] <= 45.5) { + if (features[0] <= 3.0) { + if (features[7] <= 77.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[1] <= 42.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[14] <= 9.5) { + if (features[16] <= 1.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[9] <= 21.5) { + if (features[12] <= 11.5) { + if (features[9] <= 20.0) { + if (features[1] <= 87.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 19; + } + } else { + classes[0] = 0; + classes[1] = 52; + } + } + } else { + if (features[16] <= 2.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + if (features[16] <= 3.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + classes[0] = 0; + classes[1] = 55; + } + } + } else { + if (features[1] <= 233.0) { + if (features[8] <= 2.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[9] <= 138.0) { + if (features[17] <= 0.5) { + if (features[15] <= 13.5) { + classes[0] = 20; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[7] <= 287.0) { + classes[0] = 11; + classes[1] = 0; + } else { + if (features[7] <= 352.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_7(float features[]) { + int classes[2]; + + if (features[4] <= 65.5) { + if (features[17] <= 0.5) { + if (features[0] <= 29.5) { + if (features[16] <= 1.5) { + if (features[9] <= 36.5) { + if (features[18] <= 0.5) { + if (features[1] <= 36.5) { + if (features[12] <= 3.5) { + classes[0] = 226; + classes[1] = 0; + } else { + if (features[1] <= 35.0) { + classes[0] = 36; + classes[1] = 0; + } else { + if (features[11] <= 1.0) { + if (features[0] <= 1.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[7] <= 30.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 376; + classes[1] = 0; + } + } else { + if (features[0] <= 12.5) { + classes[0] = 25; + classes[1] = 0; + } else { + if (features[13] <= 0.5) { + if (features[14] <= 0.5) { + classes[0] = 15; + classes[1] = 0; + } else { + if (features[2] <= 39.0) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + if (features[13] <= 1.5) { + if (features[9] <= 38.0) { + if (features[16] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 35; + classes[1] = 0; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + if (features[9] <= 16.5) { + if (features[2] <= 26.5) { + if (features[0] <= 2.5) { + if (features[1] <= 1.0) { + if (features[7] <= 0.5) { + if (features[16] <= 5.5) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 33; + classes[1] = 0; + } + } else { + if (features[16] <= 4.5) { + if (features[18] <= 0.5) { + if (features[12] <= 0.5) { + if (features[2] <= 5.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[16] <= 3.5) { + if (features[1] <= 55.5) { + if (features[9] <= 2.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[15] <= 0.5) { + if (features[11] <= 2.0) { + if (features[12] <= 6.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + if (features[0] <= 6.0) { + if (features[11] <= 0.5) { + if (features[2] <= 11.5) { + if (features[12] <= 50.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + if (features[7] <= 123.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[2] <= 18.5) { + if (features[1] <= 90.0) { + if (features[1] <= 75.0) { + classes[0] = 16; + classes[1] = 0; + } else { + if (features[13] <= 0.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 18; + classes[1] = 0; + } + } else { + classes[0] = 19; + classes[1] = 0; + } + } + } + } else { + if (features[0] <= 4.5) { + if (features[12] <= 8.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } + } else { + if (features[9] <= 10.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[12] <= 26.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[12] <= 8.5) { + if (features[7] <= 160.0) { + if (features[15] <= 2.5) { + if (features[0] <= 12.5) { + classes[0] = 0; + classes[1] = 12; + } else { + if (features[0] <= 19.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[5] <= 2.0) { + if (features[12] <= 20.5) { + if (features[4] <= 9.5) { + if (features[2] <= 79.0) { + if (features[12] <= 16.5) { + if (features[9] <= 14.5) { + if (features[12] <= 15.0) { + if (features[0] <= 12.0) { + if (features[1] <= 70.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[18] <= 0.5) { + if (features[7] <= 101.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[15] <= 16.5) { + if (features[2] <= 51.0) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[0] <= 8.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[1] <= 325.0) { + if (features[12] <= 17.5) { + if (features[1] <= 93.0) { + if (features[5] <= 7.5) { + if (features[11] <= 5.0) { + if (features[2] <= 14.5) { + if (features[1] <= 30.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[7] <= 15.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 14; + } + } + } else { + classes[0] = 0; + classes[1] = 29; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[9] <= 52.5) { + if (features[14] <= 7.5) { + if (features[7] <= 92.0) { + if (features[1] <= 108.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[7] <= 59.0) { + if (features[12] <= 10.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } else { + if (features[16] <= 2.5) { + if (features[12] <= 16.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[15] <= 2.0) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[9] <= 42.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + if (features[1] <= 59.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[15] <= 27.5) { + if (features[9] <= 39.0) { + classes[0] = 0; + classes[1] = 37; + } else { + if (features[12] <= 22.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[15] <= 4.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } else { + if (features[5] <= 0.5) { + if (features[0] <= 36.5) { + if (features[7] <= 270.0) { + if (features[14] <= 0.5) { + if (features[0] <= 33.5) { + classes[0] = 30; + classes[1] = 0; + } else { + if (features[18] <= 0.5) { + classes[0] = 24; + classes[1] = 0; + } else { + if (features[16] <= 1.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[14] <= 2.5) { + if (features[9] <= 34.0) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[12] <= 12.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + classes[0] = 25; + classes[1] = 0; + } + } else { + if (features[16] <= 2.5) { + classes[0] = 291; + classes[1] = 0; + } else { + if (features[0] <= 50.5) { + if (features[1] <= 139.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 19; + classes[1] = 0; + } + } + } + } else { + if (features[2] <= 33.0) { + if (features[5] <= 11.5) { + classes[0] = 12; + classes[1] = 0; + } else { + if (features[0] <= 79.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } + } else { + if (features[12] <= 69.5) { + if (features[8] <= 46.0) { + if (features[16] <= 0.5) { + classes[0] = 11; + classes[1] = 0; + } else { + if (features[9] <= 1.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[15] <= 2.5) { + if (features[0] <= 1.0) { + if (features[1] <= 193.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[12] <= 28.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[7] <= 129.5) { + classes[0] = 0; + classes[1] = 53; + } else { + if (features[7] <= 134.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 43; + } + } + } + } else { + if (features[12] <= 33.5) { + classes[0] = 0; + classes[1] = 76; + } else { + if (features[18] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[12] <= 50.5) { + if (features[9] <= 18.5) { + if (features[17] <= 0.5) { + if (features[1] <= 52.0) { + if (features[7] <= 22.5) { + if (features[0] <= 1.5) { + if (features[9] <= 12.5) { + if (features[8] <= 1.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[15] <= 1.5) { + if (features[14] <= 0.5) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[2] <= 10.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 21; + classes[1] = 0; + } + } + } else { + if (features[13] <= 0.5) { + if (features[16] <= 1.0) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[7] <= 168.0) { + classes[0] = 0; + classes[1] = 24; + } else { + if (features[16] <= 3.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[7] <= 339.0) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[12] <= 39.0) { + if (features[15] <= 7.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[15] <= 2.5) { + if (features[5] <= 0.5) { + if (features[16] <= 1.5) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[13] <= 2.0) { + if (features[4] <= 135.0) { + if (features[1] <= 296.5) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } + } else { + if (features[14] <= 0.5) { + if (features[1] <= 150.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 16; + } + } + } else { + if (features[9] <= 38.5) { + if (features[16] <= 0.5) { + classes[0] = 12; + classes[1] = 0; + } else { + if (features[9] <= 27.5) { + if (features[7] <= 100.5) { + if (features[2] <= 27.5) { + classes[0] = 0; + classes[1] = 43; + } else { + if (features[12] <= 7.5) { + if (features[1] <= 75.0) { + classes[0] = 0; + classes[1] = 8; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } + } else { + if (features[2] <= 51.0) { + if (features[9] <= 23.5) { + if (features[8] <= 0.5) { + classes[0] = 0; + classes[1] = 12; + } else { + if (features[8] <= 3.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[3] <= 2.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[16] <= 2.5) { + if (features[3] <= 2.5) { + if (features[12] <= 9.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + if (features[15] <= 8.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[7] <= 176.0) { + classes[0] = 0; + classes[1] = 36; + } else { + if (features[18] <= 0.5) { + if (features[4] <= 288.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } + } else { + if (features[7] <= 183.5) { + if (features[2] <= 8.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[1] <= 24.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[3] <= 1.5) { + if (features[18] <= 0.5) { + if (features[16] <= 1.5) { + if (features[12] <= 1.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[1] <= 262.0) { + classes[0] = 0; + classes[1] = 28; + } else { + if (features[15] <= 2.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[9] <= 41.0) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[3] <= 5.5) { + if (features[9] <= 50.5) { + if (features[2] <= 35.5) { + if (features[4] <= 419.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[3] <= 3.5) { + if (features[12] <= 24.0) { + classes[0] = 19; + classes[1] = 0; + } else { + if (features[14] <= 0.5) { + if (features[1] <= 209.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[0] <= 32.0) { + classes[0] = 0; + classes[1] = 8; + } else { + if (features[3] <= 15.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } + } + } + } else { + if (features[16] <= 5.0) { + if (features[12] <= 83.5) { + classes[0] = 14; + classes[1] = 0; + } else { + if (features[4] <= 411.0) { + classes[0] = 19; + classes[1] = 0; + } else { + if (features[7] <= 139.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_8(float features[]) { + int classes[2]; + + if (features[7] <= 21.5) { + if (features[11] <= 9.5) { + if (features[16] <= 4.5) { + if (features[8] <= 1.5) { + if (features[3] <= 3.0) { + if (features[12] <= 3.5) { + classes[0] = 233; + classes[1] = 0; + } else { + if (features[7] <= 6.5) { + if (features[1] <= 69.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 22; + classes[1] = 0; + } + } + } else { + if (features[9] <= 23.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[7] <= 17.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[2] <= 1.0) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[1] <= 203.0) { + if (features[12] <= 0.5) { + if (features[16] <= 5.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[9] <= 20.5) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[7] <= 249.5) { + if (features[16] <= 1.5) { + if (features[7] <= 242.5) { + if (features[17] <= 0.5) { + if (features[12] <= 18.5) { + if (features[3] <= 0.5) { + if (features[1] <= 465.5) { + if (features[2] <= 47.0) { + if (features[16] <= 0.5) { + classes[0] = 303; + classes[1] = 0; + } else { + if (features[12] <= 6.5) { + classes[0] = 49; + classes[1] = 0; + } else { + if (features[7] <= 188.5) { + if (features[12] <= 9.5) { + classes[0] = 19; + classes[1] = 0; + } else { + if (features[13] <= 1.5) { + classes[0] = 14; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[1] <= 61.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + if (features[15] <= 1.5) { + classes[0] = 13; + classes[1] = 0; + } else { + if (features[18] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[9] <= 14.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + if (features[9] <= 154.0) { + if (features[11] <= 3.0) { + if (features[2] <= 39.5) { + classes[0] = 49; + classes[1] = 0; + } else { + if (features[16] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[13] <= 0.5) { + if (features[0] <= 12.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 158; + classes[1] = 0; + } + } else { + if (features[14] <= 0.5) { + if (features[9] <= 10.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[7] <= 61.0) { + if (features[15] <= 6.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 25; + } + } + } + } else { + if (features[1] <= 92.5) { + classes[0] = 0; + classes[1] = 15; + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + if (features[16] <= 2.5) { + if (features[12] <= 39.5) { + if (features[9] <= 14.5) { + if (features[12] <= 9.5) { + if (features[15] <= 3.5) { + if (features[1] <= 93.5) { + if (features[18] <= 0.5) { + if (features[8] <= 0.5) { + if (features[7] <= 39.5) { + if (features[1] <= 18.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[15] <= 0.5) { + if (features[12] <= 6.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[3] <= 0.5) { + if (features[0] <= 17.5) { + classes[0] = 15; + classes[1] = 0; + } else { + if (features[9] <= 5.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[14] <= 5.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[7] <= 145.0) { + classes[0] = 19; + classes[1] = 0; + } else { + if (features[2] <= 33.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[13] <= 2.5) { + if (features[18] <= 0.5) { + if (features[2] <= 6.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[4] <= 78.5) { + if (features[0] <= 37.0) { + if (features[8] <= 0.5) { + if (features[9] <= 19.0) { + if (features[2] <= 10.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[12] <= 14.0) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[0] <= 8.5) { + if (features[14] <= 5.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[9] <= 20.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[13] <= 0.5) { + if (features[1] <= 64.5) { + if (features[9] <= 44.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[5] <= 7.5) { + if (features[2] <= 8.0) { + if (features[9] <= 28.5) { + if (features[9] <= 19.0) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[1] <= 134.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 14; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[11] <= 0.5) { + if (features[4] <= 133.5) { + classes[0] = 0; + classes[1] = 23; + } else { + if (features[12] <= 6.0) { + classes[0] = 0; + classes[1] = 8; + } else { + if (features[2] <= 37.5) { + if (features[9] <= 47.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[12] <= 13.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 27; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[8] <= 5.5) { + if (features[7] <= 135.5) { + classes[0] = 20; + classes[1] = 0; + } else { + if (features[1] <= 393.5) { + if (features[4] <= 381.5) { + if (features[9] <= 31.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + if (features[9] <= 89.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[14] <= 0.5) { + if (features[0] <= 15.5) { + if (features[4] <= 31.5) { + if (features[2] <= 20.5) { + if (features[11] <= 1.0) { + if (features[7] <= 53.0) { + if (features[15] <= 1.0) { + if (features[1] <= 84.0) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[7] <= 73.0) { + classes[0] = 0; + classes[1] = 15; + } else { + if (features[9] <= 7.5) { + classes[0] = 8; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 15; + } + } + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } else { + if (features[6] <= 0.5) { + if (features[13] <= 1.0) { + classes[0] = 0; + classes[1] = 15; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[13] <= 1.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 3.5) { + classes[0] = 0; + classes[1] = 26; + } else { + if (features[0] <= 3.0) { + if (features[9] <= 17.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[13] <= 0.5) { + classes[0] = 0; + classes[1] = 16; + } else { + if (features[11] <= 0.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[3] <= 10.0) { + if (features[7] <= 201.5) { + if (features[7] <= 91.0) { + if (features[7] <= 81.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[16] <= 3.5) { + classes[0] = 18; + classes[1] = 0; + } else { + if (features[9] <= 37.0) { + classes[0] = 10; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[1] <= 109.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[0] <= 22.0) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[15] <= 10.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[12] <= 28.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[2] <= 64.5) { + if (features[4] <= 91.5) { + if (features[9] <= 5.5) { + if (features[9] <= 1.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[17] <= 0.5) { + if (features[15] <= 5.5) { + if (features[12] <= 200.0) { + if (features[13] <= 0.5) { + if (features[2] <= 24.5) { + if (features[14] <= 9.5) { + if (features[2] <= 17.5) { + classes[0] = 0; + classes[1] = 18; + } else { + if (features[8] <= 0.5) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[1] <= 89.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } else { + classes[0] = 0; + classes[1] = 32; + } + } else { + if (features[9] <= 40.5) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[16] <= 3.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[8] <= 0.5) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[18] <= 0.5) { + if (features[15] <= 10.0) { + classes[0] = 0; + classes[1] = 13; + } else { + if (features[2] <= 48.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 98; + } + } + } + } else { + if (features[9] <= 14.0) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[16] <= 5.5) { + if (features[4] <= 237.5) { + if (features[7] <= 202.0) { + if (features[1] <= 47.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[4] <= 203.0) { + classes[0] = 0; + classes[1] = 14; + } else { + if (features[14] <= 2.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 55; + } + } else { + if (features[17] <= 0.5) { + if (features[8] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } + } else { + if (features[14] <= 2.0) { + if (features[15] <= 2.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[16] <= 3.5) { + if (features[14] <= 0.5) { + if (features[12] <= 5.5) { + if (features[2] <= 32.0) { + classes[0] = 28; + classes[1] = 0; + } else { + if (features[18] <= 0.5) { + if (features[16] <= 1.5) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[1] <= 126.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[17] <= 0.5) { + classes[0] = 229; + classes[1] = 0; + } else { + if (features[9] <= 31.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[16] <= 1.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + if (features[5] <= 0.5) { + if (features[17] <= 0.5) { + if (features[4] <= 169.0) { + if (features[8] <= 2.5) { + if (features[0] <= 26.5) { + if (features[7] <= 333.5) { + classes[0] = 22; + classes[1] = 0; + } else { + if (features[2] <= 37.5) { + classes[0] = 12; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 80; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[1] <= 186.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + if (features[7] <= 262.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[0] <= 14.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } else { + if (features[0] <= 27.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } + } else { + if (features[16] <= 6.5) { + if (features[12] <= 42.0) { + if (features[0] <= 25.0) { + if (features[13] <= 2.0) { + if (features[12] <= 7.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[14] <= 0.5) { + if (features[12] <= 25.5) { + classes[0] = 0; + classes[1] = 9; + } else { + if (features[0] <= 14.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[1] <= 323.0) { + if (features[3] <= 0.5) { + if (features[2] <= 41.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 27; + } + } else { + if (features[12] <= 43.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[8] <= 0.5) { + if (features[15] <= 1.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_9(float features[]) { + int classes[2]; + + if (features[16] <= 1.5) { + if (features[18] <= 0.5) { + if (features[16] <= 0.5) { + classes[0] = 813; + classes[1] = 0; + } else { + if (features[17] <= 0.5) { + if (features[9] <= 148.0) { + if (features[4] <= 178.5) { + if (features[0] <= 18.5) { + if (features[7] <= 197.5) { + if (features[0] <= 14.5) { + if (features[7] <= 6.0) { + if (features[2] <= 5.5) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[7] <= 3.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[0] <= 9.5) { + classes[0] = 102; + classes[1] = 0; + } else { + if (features[2] <= 11.5) { + if (features[9] <= 5.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 16; + classes[1] = 0; + } + } + } + } else { + if (features[3] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[7] <= 291.5) { + if (features[0] <= 13.0) { + if (features[2] <= 22.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + classes[0] = 64; + classes[1] = 0; + } + } else { + if (features[9] <= 16.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[7] <= 249.0) { + if (features[1] <= 108.0) { + if (features[9] <= 9.5) { + classes[0] = 16; + classes[1] = 0; + } else { + if (features[16] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 28; + } + } + } else { + classes[0] = 59; + classes[1] = 0; + } + } else { + classes[0] = 102; + classes[1] = 0; + } + } + } else { + if (features[18] <= 0.5) { + if (features[7] <= 24.5) { + if (features[9] <= 6.5) { + classes[0] = 55; + classes[1] = 0; + } else { + if (features[0] <= 26.0) { + if (features[12] <= 1.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[3] <= 3.0) { + if (features[17] <= 0.5) { + if (features[3] <= 1.5) { + if (features[1] <= 16.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[9] <= 18.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[3] <= 1.5) { + if (features[5] <= 0.5) { + if (features[0] <= 20.5) { + if (features[1] <= 184.5) { + if (features[13] <= 0.5) { + if (features[11] <= 2.5) { + if (features[14] <= 2.5) { + if (features[1] <= 112.5) { + if (features[4] <= 100.0) { + if (features[7] <= 57.5) { + if (features[9] <= 16.5) { + if (features[12] <= 0.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[1] <= 54.5) { + if (features[11] <= 0.5) { + classes[0] = 13; + classes[1] = 0; + } else { + if (features[16] <= 3.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[2] <= 7.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[4] <= 42.0) { + classes[0] = 10; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + if (features[0] <= 14.5) { + if (features[12] <= 3.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 21; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[0] <= 10.5) { + if (features[6] <= 0.5) { + if (features[1] <= 28.5) { + if (features[12] <= 2.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[9] <= 13.0) { + if (features[15] <= 2.5) { + if (features[0] <= 5.5) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 39; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[1] <= 45.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[15] <= 19.5) { + if (features[12] <= 9.0) { + classes[0] = 0; + classes[1] = 10; + } else { + if (features[0] <= 12.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[16] <= 2.5) { + if (features[12] <= 25.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[2] <= 24.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } else { + if (features[7] <= 48.0) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[6] <= 0.5) { + if (features[9] <= 15.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[15] <= 4.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[0] <= 1.5) { + if (features[16] <= 4.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[11] <= 0.5) { + if (features[16] <= 2.5) { + if (features[8] <= 0.5) { + if (features[0] <= 14.5) { + classes[0] = 0; + classes[1] = 8; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 22; + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } + } + } else { + if (features[2] <= 8.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[3] <= 0.5) { + if (features[0] <= 11.0) { + classes[0] = 10; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[1] <= 113.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + if (features[6] <= 1.5) { + if (features[12] <= 2.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[8] <= 0.5) { + if (features[9] <= 24.5) { + if (features[4] <= 46.0) { + if (features[15] <= 0.5) { + if (features[12] <= 20.5) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } else { + if (features[16] <= 3.0) { + if (features[11] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[15] <= 5.0) { + if (features[0] <= 14.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[7] <= 111.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[14] <= 0.5) { + if (features[4] <= 31.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + if (features[4] <= 83.5) { + if (features[3] <= 0.5) { + if (features[12] <= 53.0) { + if (features[16] <= 3.5) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[0] <= 4.5) { + if (features[1] <= 236.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[9] <= 2.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 19; + classes[1] = 0; + } + } + } else { + if (features[4] <= 99.5) { + if (features[12] <= 37.5) { + if (features[8] <= 3.5) { + if (features[14] <= 0.5) { + if (features[16] <= 4.5) { + if (features[12] <= 12.0) { + if (features[9] <= 18.0) { + if (features[0] <= 23.0) { + if (features[2] <= 17.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 26; + classes[1] = 0; + } + } else { + if (features[8] <= 0.5) { + if (features[7] <= 446.0) { + classes[0] = 11; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 34; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[2] <= 28.0) { + if (features[0] <= 73.0) { + classes[0] = 11; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[13] <= 0.5) { + if (features[11] <= 0.5) { + if (features[9] <= 104.0) { + if (features[7] <= 46.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 10; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[7] <= 152.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 30; + classes[1] = 0; + } + } + } else { + if (features[7] <= 225.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } + } else { + if (features[2] <= 25.0) { + if (features[15] <= 5.5) { + if (features[2] <= 11.0) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[1] <= 65.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 21; + } + } + } else { + if (features[9] <= 14.5) { + if (features[13] <= 0.5) { + if (features[16] <= 3.0) { + if (features[3] <= 4.0) { + if (features[1] <= 30.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[0] <= 14.5) { + if (features[16] <= 5.0) { + if (features[4] <= 283.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[5] <= 9.0) { + classes[0] = 0; + classes[1] = 8; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[7] <= 121.0) { + if (features[16] <= 2.5) { + if (features[9] <= 20.0) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[12] <= 8.0) { + if (features[14] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + classes[0] = 0; + classes[1] = 44; + } + } else { + if (features[7] <= 139.0) { + if (features[15] <= 0.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 9; + classes[1] = 0; + } + } else { + if (features[14] <= 4.5) { + if (features[8] <= 7.0) { + if (features[12] <= 8.0) { + if (features[12] <= 6.5) { + if (features[0] <= 42.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[2] <= 17.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[16] <= 3.5) { + if (features[4] <= 714.0) { + classes[0] = 0; + classes[1] = 7; + } else { + if (features[14] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + classes[0] = 0; + classes[1] = 17; + } + } + } else { + if (features[2] <= 35.0) { + if (features[4] <= 1511.0) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[12] <= 40.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } + } + } + } + } else { + if (features[4] <= 39.0) { + if (features[16] <= 4.5) { + if (features[8] <= 0.5) { + if (features[16] <= 3.5) { + if (features[5] <= 0.5) { + if (features[2] <= 72.5) { + if (features[15] <= 16.0) { + if (features[12] <= 28.0) { + if (features[7] <= 26.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[16] <= 2.5) { + if (features[12] <= 12.0) { + if (features[9] <= 7.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 0; + classes[1] = 21; + } + } else { + classes[0] = 0; + classes[1] = 30; + } + } + } else { + if (features[1] <= 237.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[15] <= 2.5) { + if (features[2] <= 45.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[15] <= 4.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[14] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[7] <= 308.5) { + if (features[9] <= 6.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 21; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 20; + } + } else { + classes[0] = 0; + classes[1] = 56; + } + } else { + classes[0] = 0; + classes[1] = 49; + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_10(float features[]) { + int classes[2]; + + if (features[18] <= 0.5) { + if (features[16] <= 1.5) { + if (features[3] <= 1.5) { + if (features[17] <= 0.5) { + if (features[4] <= 85.5) { + if (features[12] <= 11.5) { + if (features[2] <= 6.5) { + classes[0] = 174; + classes[1] = 0; + } else { + if (features[12] <= 9.5) { + if (features[7] <= 6.0) { + if (features[0] <= 2.0) { + classes[0] = 13; + classes[1] = 0; + } else { + if (features[2] <= 21.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 228; + classes[1] = 0; + } else { + if (features[7] <= 182.5) { + classes[0] = 86; + classes[1] = 0; + } else { + if (features[7] <= 214.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 10; + classes[1] = 0; + } + } + } + } + } else { + if (features[1] <= 388.0) { + if (features[2] <= 37.5) { + classes[0] = 42; + classes[1] = 0; + } else { + if (features[14] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[0] <= 39.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 404; + classes[1] = 0; + } + } else { + if (features[4] <= 90.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 35; + classes[1] = 0; + } + } + } else { + if (features[15] <= 4.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[17] <= 0.5) { + if (features[12] <= 3.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[9] <= 44.0) { + classes[0] = 15; + classes[1] = 0; + } else { + if (features[16] <= 0.5) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[7] <= 163.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[1] <= 21.5) { + if (features[7] <= 75.5) { + classes[0] = 44; + classes[1] = 0; + } else { + if (features[11] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[9] <= 13.5) { + if (features[0] <= 7.5) { + if (features[17] <= 0.5) { + if (features[16] <= 4.5) { + if (features[15] <= 2.5) { + if (features[8] <= 1.5) { + if (features[7] <= 32.0) { + if (features[2] <= 7.5) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[3] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[1] <= 65.5) { + if (features[1] <= 37.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[11] <= 0.5) { + if (features[12] <= 1.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[12] <= 6.5) { + classes[0] = 0; + classes[1] = 8; + } else { + if (features[12] <= 8.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[9] <= 9.0) { + if (features[2] <= 21.5) { + if (features[1] <= 315.0) { + classes[0] = 11; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[14] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[0] <= 3.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 15; + classes[1] = 0; + } + } else { + if (features[9] <= 4.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[0] <= 5.5) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + if (features[7] <= 421.5) { + if (features[14] <= 0.5) { + if (features[13] <= 0.5) { + if (features[1] <= 47.5) { + if (features[1] <= 44.0) { + if (features[11] <= 1.5) { + if (features[12] <= 6.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + if (features[3] <= 1.5) { + if (features[12] <= 0.5) { + if (features[9] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 46; + classes[1] = 0; + } + } else { + if (features[1] <= 122.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + if (features[2] <= 42.5) { + classes[0] = 29; + classes[1] = 0; + } else { + if (features[12] <= 15.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[1] <= 83.5) { + if (features[1] <= 44.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[7] <= 72.0) { + if (features[9] <= 8.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[8] <= 5.5) { + if (features[1] <= 179.5) { + classes[0] = 14; + classes[1] = 0; + } else { + if (features[9] <= 8.0) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[0] <= 51.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } + } else { + if (features[0] <= 52.5) { + if (features[8] <= 2.5) { + if (features[0] <= 20.5) { + if (features[7] <= 203.0) { + if (features[11] <= 0.5) { + if (features[13] <= 4.0) { + if (features[2] <= 9.5) { + if (features[9] <= 24.5) { + if (features[3] <= 0.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[14] <= 0.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[8] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[9] <= 36.5) { + classes[0] = 0; + classes[1] = 12; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[5] <= 12.5) { + if (features[13] <= 1.5) { + if (features[1] <= 29.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[2] <= 27.5) { + if (features[16] <= 2.5) { + if (features[12] <= 4.5) { + if (features[2] <= 20.5) { + if (features[0] <= 12.5) { + if (features[12] <= 3.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 0; + classes[1] = 35; + } + } else { + classes[0] = 0; + classes[1] = 92; + } + } else { + if (features[0] <= 5.5) { + if (features[7] <= 77.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[2] <= 38.5) { + if (features[9] <= 16.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[17] <= 0.5) { + classes[0] = 0; + classes[1] = 8; + } else { + if (features[9] <= 22.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 13; + } + } + } + } + } else { + if (features[9] <= 27.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[13] <= 2.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[9] <= 33.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[14] <= 4.5) { + if (features[9] <= 34.5) { + if (features[7] <= 41.0) { + if (features[9] <= 19.0) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[2] <= 22.5) { + if (features[4] <= 12.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 17; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[9] <= 16.5) { + if (features[0] <= 4.5) { + if (features[15] <= 3.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 11; + classes[1] = 0; + } + } else { + if (features[7] <= 219.0) { + if (features[0] <= 12.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[9] <= 34.5) { + if (features[9] <= 27.5) { + classes[0] = 0; + classes[1] = 8; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 16; + } + } + } + } + } else { + if (features[14] <= 0.5) { + if (features[12] <= 43.0) { + if (features[11] <= 0.5) { + if (features[7] <= 153.5) { + if (features[6] <= 3.5) { + if (features[13] <= 1.5) { + if (features[1] <= 138.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 12; + classes[1] = 0; + } + } else { + if (features[1] <= 264.5) { + if (features[0] <= 26.5) { + if (features[13] <= 1.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[9] <= 110.0) { + if (features[1] <= 364.5) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[9] <= 20.5) { + if (features[7] <= 158.5) { + if (features[3] <= 1.5) { + if (features[2] <= 21.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[12] <= 26.0) { + if (features[0] <= 31.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + if (features[8] <= 0.5) { + if (features[9] <= 43.0) { + if (features[1] <= 64.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[9] <= 25.5) { + if (features[2] <= 33.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } + } else { + if (features[0] <= 24.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[0] <= 46.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 11; + } + } + } + } + } else { + if (features[12] <= 106.5) { + if (features[15] <= 10.5) { + if (features[1] <= 38.0) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[4] <= 502.0) { + if (features[14] <= 5.0) { + if (features[14] <= 1.5) { + if (features[8] <= 6.5) { + if (features[1] <= 174.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 12; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[16] <= 3.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + classes[0] = 19; + classes[1] = 0; + } + } + } else { + if (features[4] <= 41.5) { + if (features[16] <= 2.5) { + if (features[9] <= 19.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 13; + classes[1] = 0; + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } else { + if (features[15] <= 3.0) { + if (features[2] <= 52.0) { + if (features[16] <= 3.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[4] <= 1110.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } + } + } else { + if (features[0] <= 24.5) { + if (features[14] <= 0.5) { + if (features[15] <= 1.5) { + if (features[9] <= 20.5) { + if (features[1] <= 31.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 11; + classes[1] = 0; + } + } else { + if (features[12] <= 4.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[16] <= 1.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 30; + } + } + } + } else { + if (features[16] <= 1.5) { + classes[0] = 16; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 12; + classes[1] = 0; + } else { + if (features[14] <= 2.0) { + if (features[2] <= 48.0) { + if (features[1] <= 18.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 71; + } + } else { + if (features[2] <= 52.5) { + if (features[16] <= 1.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[12] <= 13.0) { + classes[0] = 0; + classes[1] = 10; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 42; + } + } + } + } else { + if (features[9] <= 8.5) { + classes[0] = 57; + classes[1] = 0; + } else { + if (features[12] <= 6.5) { + if (features[0] <= 51.0) { + if (features[2] <= 19.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 31; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[16] <= 1.0) { + classes[0] = 74; + classes[1] = 0; + } else { + if (features[1] <= 90.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[13] <= 0.5) { + if (features[15] <= 15.0) { + classes[0] = 0; + classes[1] = 34; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[8] <= 0.5) { + if (features[7] <= 241.0) { + if (features[9] <= 22.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_11(float features[]) { + int classes[2]; + + if (features[18] <= 0.5) { + if (features[16] <= 1.5) { + if (features[8] <= 3.5) { + if (features[3] <= 1.5) { + if (features[9] <= 24.5) { + if (features[2] <= 11.5) { + if (features[15] <= 0.5) { + if (features[12] <= 3.5) { + classes[0] = 163; + classes[1] = 0; + } else { + if (features[1] <= 36.5) { + if (features[0] <= 3.5) { + if (features[1] <= 33.5) { + classes[0] = 8; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 13; + classes[1] = 0; + } + } else { + if (features[16] <= 0.5) { + classes[0] = 58; + classes[1] = 0; + } else { + if (features[9] <= 1.0) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[4] <= 9.0) { + if (features[12] <= 9.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } + } else { + classes[0] = 68; + classes[1] = 0; + } + } else { + classes[0] = 451; + classes[1] = 0; + } + } else { + if (features[16] <= 0.5) { + classes[0] = 142; + classes[1] = 0; + } else { + if (features[7] <= 68.5) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[9] <= 27.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[2] <= 12.5) { + if (features[13] <= 1.5) { + if (features[0] <= 53.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 17; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[1] <= 129.5) { + if (features[0] <= 19.0) { + if (features[9] <= 16.5) { + if (features[0] <= 1.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + classes[0] = 22; + classes[1] = 0; + } + } + } else { + if (features[7] <= 84.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[0] <= 4.5) { + if (features[3] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 25; + classes[1] = 0; + } + } + } + } else { + if (features[14] <= 0.5) { + if (features[8] <= 69.5) { + if (features[1] <= 12.5) { + classes[0] = 36; + classes[1] = 0; + } else { + if (features[3] <= 1.5) { + if (features[9] <= 13.5) { + if (features[0] <= 5.5) { + if (features[2] <= 18.5) { + if (features[12] <= 0.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[0] <= 4.5) { + if (features[2] <= 2.5) { + if (features[2] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 20; + classes[1] = 0; + } + } else { + if (features[16] <= 2.5) { + if (features[12] <= 46.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[3] <= 0.5) { + if (features[16] <= 2.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[1] <= 127.5) { + if (features[13] <= 0.5) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[12] <= 28.5) { + if (features[1] <= 50.0) { + if (features[16] <= 2.5) { + if (features[0] <= 17.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[11] <= 5.0) { + if (features[7] <= 179.5) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } else { + if (features[4] <= 93.0) { + if (features[1] <= 77.0) { + if (features[0] <= 19.5) { + classes[0] = 13; + classes[1] = 0; + } else { + if (features[0] <= 24.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } else { + classes[0] = 50; + classes[1] = 0; + } + } else { + if (features[4] <= 98.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } + } else { + if (features[12] <= 32.0) { + if (features[9] <= 8.0) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } else { + if (features[13] <= 2.5) { + if (features[1] <= 254.0) { + if (features[15] <= 4.5) { + if (features[16] <= 4.5) { + if (features[12] <= 9.5) { + if (features[2] <= 14.5) { + if (features[4] <= 42.0) { + if (features[7] <= 15.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[0] <= 9.5) { + if (features[2] <= 8.0) { + if (features[7] <= 23.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[6] <= 13.0) { + if (features[0] <= 29.0) { + if (features[8] <= 0.5) { + classes[0] = 0; + classes[1] = 23; + } else { + if (features[1] <= 106.0) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[7] <= 84.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[9] <= 42.5) { + if (features[15] <= 2.0) { + if (features[4] <= 72.5) { + if (features[16] <= 2.5) { + if (features[12] <= 17.0) { + if (features[12] <= 14.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + if (features[4] <= 153.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[7] <= 280.0) { + if (features[15] <= 3.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[2] <= 56.0) { + classes[0] = 0; + classes[1] = 13; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[16] <= 4.5) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[3] <= 0.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[0] <= 11.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } else { + classes[0] = 16; + classes[1] = 0; + } + } + } else { + if (features[0] <= 13.5) { + if (features[7] <= 24.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[16] <= 2.5) { + if (features[7] <= 95.0) { + classes[0] = 0; + classes[1] = 8; + } else { + if (features[4] <= 1015.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[9] <= 4.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 39; + } + } + } + } else { + if (features[2] <= 35.0) { + if (features[0] <= 48.5) { + if (features[7] <= 92.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[12] <= 6.0) { + if (features[4] <= 1012.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 13; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[11] <= 3.0) { + if (features[8] <= 1.5) { + if (features[9] <= 14.5) { + if (features[0] <= 0.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[2] <= 23.5) { + if (features[0] <= 1.5) { + if (features[1] <= 96.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[7] <= 43.0) { + if (features[3] <= 1.0) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 27; + classes[1] = 0; + } + } + } else { + if (features[1] <= 79.0) { + classes[0] = 0; + classes[1] = 10; + } else { + if (features[12] <= 9.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[2] <= 39.0) { + if (features[15] <= 2.0) { + if (features[6] <= 0.5) { + if (features[4] <= 71.5) { + if (features[7] <= 92.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } + } else { + if (features[7] <= 193.5) { + if (features[15] <= 9.0) { + if (features[14] <= 7.5) { + if (features[0] <= 3.5) { + if (features[15] <= 0.5) { + if (features[3] <= 1.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[2] <= 19.0) { + if (features[2] <= 13.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } else { + if (features[0] <= 21.5) { + classes[0] = 0; + classes[1] = 88; + } else { + if (features[6] <= 12.0) { + if (features[15] <= 3.5) { + if (features[2] <= 23.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 24; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[7] <= 111.0) { + if (features[16] <= 3.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[15] <= 12.5) { + if (features[16] <= 3.5) { + if (features[7] <= 48.5) { + if (features[14] <= 5.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + if (features[1] <= 193.0) { + if (features[14] <= 14.5) { + if (features[4] <= 44.5) { + if (features[12] <= 5.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[15] <= 3.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[0] <= 12.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[14] <= 4.0) { + if (features[16] <= 3.5) { + if (features[7] <= 352.0) { + if (features[12] <= 23.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[2] <= 5.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[9] <= 25.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[9] <= 59.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 11; + classes[1] = 0; + } + } + } + } + } else { + if (features[12] <= 30.0) { + if (features[0] <= 3.0) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[0] <= 36.0) { + classes[0] = 0; + classes[1] = 12; + } else { + if (features[0] <= 79.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[15] <= 11.5) { + if (features[4] <= 1992.0) { + if (features[9] <= 78.5) { + classes[0] = 19; + classes[1] = 0; + } else { + if (features[8] <= 39.5) { + classes[0] = 8; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[8] <= 7.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } + } else { + if (features[9] <= 8.5) { + if (features[7] <= 251.0) { + if (features[17] <= 0.5) { + if (features[12] <= 9.5) { + if (features[0] <= 14.5) { + if (features[15] <= 4.0) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + classes[0] = 27; + classes[1] = 0; + } + } else { + if (features[15] <= 8.0) { + if (features[1] <= 238.5) { + if (features[3] <= 1.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + classes[0] = 35; + classes[1] = 0; + } + } else { + if (features[16] <= 0.5) { + classes[0] = 106; + classes[1] = 0; + } else { + if (features[7] <= 254.0) { + if (features[2] <= 56.5) { + classes[0] = 0; + classes[1] = 160; + } else { + if (features[15] <= 16.5) { + if (features[7] <= 122.5) { + if (features[14] <= 10.0) { + if (features[17] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + classes[0] = 0; + classes[1] = 22; + } + } else { + if (features[7] <= 214.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[1] <= 227.5) { + if (features[4] <= 48.5) { + if (features[16] <= 4.5) { + if (features[7] <= 423.5) { + if (features[2] <= 38.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + if (features[9] <= 33.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[2] <= 46.0) { + classes[0] = 0; + classes[1] = 17; + } else { + if (features[14] <= 20.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_12(float features[]) { + int classes[2]; + + if (features[4] <= 18.5) { + if (features[16] <= 1.5) { + if (features[17] <= 0.5) { + if (features[16] <= 0.5) { + classes[0] = 962; + classes[1] = 0; + } else { + if (features[7] <= 192.5) { + if (features[8] <= 0.5) { + if (features[12] <= 3.5) { + classes[0] = 83; + classes[1] = 0; + } else { + if (features[14] <= 1.5) { + if (features[15] <= 0.5) { + if (features[6] <= 0.5) { + if (features[7] <= 7.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 26; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 11; + classes[1] = 0; + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } + } else { + if (features[8] <= 1.5) { + if (features[2] <= 40.0) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[14] <= 0.5) { + if (features[12] <= 7.5) { + if (features[1] <= 112.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 22; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 16; + classes[1] = 0; + } else { + if (features[2] <= 42.0) { + classes[0] = 0; + classes[1] = 16; + } else { + if (features[2] <= 46.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + if (features[7] <= 20.5) { + if (features[16] <= 5.5) { + if (features[9] <= 6.0) { + classes[0] = 45; + classes[1] = 0; + } else { + if (features[7] <= 9.0) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[16] <= 4.5) { + if (features[17] <= 0.5) { + if (features[2] <= 22.5) { + if (features[0] <= 18.5) { + if (features[16] <= 2.5) { + if (features[0] <= 4.5) { + if (features[14] <= 0.5) { + if (features[2] <= 5.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } else { + if (features[9] <= 17.0) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[9] <= 29.0) { + if (features[2] <= 15.5) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[0] <= 12.0) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[18] <= 0.5) { + if (features[1] <= 103.0) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[1] <= 148.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + if (features[13] <= 0.5) { + if (features[9] <= 13.5) { + if (features[11] <= 0.5) { + if (features[12] <= 1.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 13; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[1] <= 59.0) { + classes[0] = 0; + classes[1] = 11; + } else { + if (features[12] <= 13.0) { + if (features[5] <= 2.0) { + if (features[12] <= 4.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 12; + } + } + } + } else { + if (features[13] <= 1.5) { + if (features[1] <= 236.0) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[0] <= 4.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } else { + if (features[0] <= 42.5) { + if (features[2] <= 6.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[18] <= 0.5) { + if (features[8] <= 1.5) { + classes[0] = 21; + classes[1] = 0; + } else { + if (features[15] <= 1.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 23; + classes[1] = 0; + } + } + } else { + if (features[13] <= 0.5) { + if (features[16] <= 2.5) { + if (features[5] <= 0.5) { + if (features[1] <= 63.5) { + if (features[0] <= 3.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 9; + } + } else { + if (features[2] <= 30.5) { + if (features[12] <= 15.5) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[15] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[0] <= 6.0) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[15] <= 2.5) { + if (features[2] <= 49.0) { + if (features[0] <= 43.0) { + classes[0] = 0; + classes[1] = 13; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[12] <= 18.5) { + if (features[11] <= 1.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[2] <= 40.5) { + if (features[7] <= 320.5) { + if (features[1] <= 285.0) { + if (features[12] <= 7.5) { + if (features[1] <= 64.0) { + if (features[7] <= 98.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[16] <= 3.5) { + classes[0] = 0; + classes[1] = 21; + } else { + if (features[1] <= 121.5) { + classes[0] = 0; + classes[1] = 9; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[7] <= 251.0) { + if (features[12] <= 10.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 12; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[15] <= 13.5) { + if (features[1] <= 131.0) { + if (features[0] <= 12.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[7] <= 53.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[9] <= 3.5) { + if (features[5] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 16; + classes[1] = 0; + } + } + } else { + if (features[9] <= 26.0) { + if (features[12] <= 28.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } + } else { + if (features[16] <= 3.5) { + if (features[2] <= 40.5) { + classes[0] = 0; + classes[1] = 39; + } else { + if (features[9] <= 51.5) { + if (features[0] <= 1.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 41; + } + } else { + if (features[5] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[15] <= 1.5) { + classes[0] = 0; + classes[1] = 8; + } else { + if (features[14] <= 2.0) { + if (features[9] <= 12.5) { + if (features[18] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } + } + } else { + if (features[18] <= 0.5) { + if (features[1] <= 209.5) { + if (features[7] <= 129.5) { + if (features[14] <= 2.0) { + classes[0] = 0; + classes[1] = 38; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[5] <= 0.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[15] <= 2.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 60; + } + } + } + } + } else { + if (features[7] <= 123.0) { + if (features[0] <= 19.5) { + if (features[16] <= 1.5) { + if (features[7] <= 45.5) { + classes[0] = 13; + classes[1] = 0; + } else { + if (features[17] <= 0.5) { + if (features[1] <= 61.0) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[12] <= 7.5) { + if (features[2] <= 36.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + if (features[6] <= 1.5) { + if (features[12] <= 3.5) { + if (features[14] <= 4.5) { + if (features[14] <= 0.5) { + if (features[11] <= 5.5) { + classes[0] = 8; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[7] <= 43.5) { + if (features[1] <= 67.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[13] <= 0.5) { + if (features[18] <= 0.5) { + if (features[1] <= 53.0) { + if (features[3] <= 5.0) { + if (features[15] <= 4.0) { + if (features[4] <= 89.0) { + if (features[12] <= 5.5) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 13; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[7] <= 24.5) { + if (features[1] <= 71.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 63; + } + } + } else { + classes[0] = 0; + classes[1] = 31; + } + } else { + if (features[0] <= 9.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[6] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + if (features[9] <= 22.0) { + classes[0] = 10; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + if (features[2] <= 18.5) { + classes[0] = 17; + classes[1] = 0; + } else { + if (features[1] <= 209.0) { + if (features[3] <= 8.5) { + classes[0] = 0; + classes[1] = 14; + } else { + if (features[7] <= 110.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 2.5) { + if (features[2] <= 19.0) { + if (features[16] <= 0.5) { + classes[0] = 21; + classes[1] = 0; + } else { + if (features[12] <= 106.5) { + if (features[11] <= 1.0) { + if (features[7] <= 133.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[7] <= 267.0) { + if (features[3] <= 2.5) { + if (features[2] <= 7.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[0] <= 9.5) { + classes[0] = 21; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[16] <= 1.5) { + classes[0] = 36; + classes[1] = 0; + } else { + if (features[14] <= 1.5) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[12] <= 21.0) { + if (features[0] <= 13.5) { + classes[0] = 0; + classes[1] = 18; + } else { + if (features[4] <= 95.0) { + if (features[15] <= 4.0) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[9] <= 5.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[7] <= 145.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[8] <= 4.0) { + classes[0] = 0; + classes[1] = 16; + } else { + if (features[3] <= 4.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } + } + } else { + if (features[0] <= 26.0) { + if (features[7] <= 186.5) { + if (features[14] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[17] <= 0.5) { + if (features[0] <= 6.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[9] <= 90.0) { + if (features[15] <= 3.0) { + classes[0] = 17; + classes[1] = 0; + } else { + if (features[7] <= 442.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[8] <= 1.5) { + classes[0] = 0; + classes[1] = 9; + } else { + if (features[14] <= 2.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[9] <= 105.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_13(float features[]) { + int classes[2]; + + if (features[16] <= 1.5) { + if (features[14] <= 0.5) { + if (features[17] <= 0.5) { + if (features[16] <= 0.5) { + classes[0] = 815; + classes[1] = 0; + } else { + if (features[4] <= 70.5) { + if (features[12] <= 3.5) { + classes[0] = 82; + classes[1] = 0; + } else { + if (features[0] <= 15.5) { + if (features[8] <= 0.5) { + if (features[1] <= 412.0) { + if (features[7] <= 7.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 36; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[12] <= 20.0) { + if (features[12] <= 6.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 33; + classes[1] = 0; + } + } + } else { + if (features[0] <= 2.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 15; + classes[1] = 0; + } + } + } + } else { + if (features[15] <= 3.0) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 14; + } + } + } else { + if (features[3] <= 1.5) { + if (features[14] <= 2.5) { + if (features[16] <= 0.5) { + classes[0] = 62; + classes[1] = 0; + } else { + if (features[12] <= 2.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[8] <= 1.5) { + classes[0] = 0; + classes[1] = 18; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 173; + classes[1] = 0; + } + } else { + if (features[16] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[7] <= 46.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } + } + } else { + if (features[16] <= 4.5) { + if (features[14] <= 0.5) { + if (features[17] <= 0.5) { + if (features[12] <= 2.5) { + if (features[7] <= 32.5) { + classes[0] = 39; + classes[1] = 0; + } else { + if (features[7] <= 35.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[0] <= 17.5) { + classes[0] = 11; + classes[1] = 0; + } else { + if (features[0] <= 21.5) { + if (features[2] <= 16.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 11; + classes[1] = 0; + } + } + } + } + } else { + if (features[0] <= 23.5) { + if (features[9] <= 7.5) { + if (features[0] <= 20.5) { + if (features[4] <= 168.0) { + if (features[8] <= 0.5) { + if (features[12] <= 77.0) { + if (features[13] <= 0.5) { + if (features[1] <= 65.5) { + if (features[1] <= 49.5) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[7] <= 98.5) { + if (features[9] <= 5.0) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[12] <= 12.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 16; + classes[1] = 0; + } + } else { + classes[0] = 16; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + if (features[2] <= 15.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[6] <= 1.5) { + if (features[13] <= 1.5) { + if (features[1] <= 212.0) { + if (features[1] <= 106.0) { + if (features[1] <= 28.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[4] <= 31.5) { + if (features[11] <= 0.5) { + if (features[2] <= 5.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[0] <= 1.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[5] <= 7.0) { + if (features[1] <= 60.5) { + classes[0] = 0; + classes[1] = 7; + } else { + if (features[7] <= 74.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[13] <= 0.5) { + if (features[0] <= 12.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[11] <= 1.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[1] <= 54.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 2.5) { + if (features[8] <= 8.5) { + if (features[4] <= 340.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 17; + } + } + } + } else { + if (features[2] <= 45.5) { + if (features[4] <= 14.0) { + if (features[1] <= 116.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[9] <= 43.0) { + if (features[7] <= 59.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[12] <= 17.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + classes[0] = 0; + classes[1] = 16; + } + } else { + if (features[18] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + if (features[1] <= 345.5) { + if (features[9] <= 19.0) { + if (features[9] <= 14.5) { + if (features[1] <= 236.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[2] <= 26.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[15] <= 1.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + if (features[2] <= 38.0) { + if (features[3] <= 4.5) { + if (features[9] <= 27.5) { + classes[0] = 35; + classes[1] = 0; + } else { + if (features[11] <= 4.0) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[16] <= 2.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[5] <= 0.5) { + if (features[0] <= 28.5) { + if (features[12] <= 27.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[9] <= 58.5) { + classes[0] = 13; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } + } else { + if (features[4] <= 43.5) { + if (features[1] <= 221.0) { + if (features[2] <= 15.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[7] <= 191.0) { + classes[0] = 0; + classes[1] = 24; + } else { + if (features[0] <= 28.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + if (features[18] <= 0.5) { + if (features[15] <= 12.5) { + if (features[1] <= 248.5) { + if (features[9] <= 7.5) { + if (features[8] <= 1.5) { + if (features[0] <= 68.0) { + if (features[12] <= 11.0) { + classes[0] = 21; + classes[1] = 0; + } else { + if (features[1] <= 82.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[1] <= 126.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[1] <= 89.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[1] <= 46.5) { + if (features[15] <= 0.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[7] <= 44.0) { + if (features[12] <= 8.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[2] <= 29.0) { + classes[0] = 8; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[14] <= 7.5) { + if (features[2] <= 60.5) { + if (features[11] <= 5.0) { + if (features[9] <= 43.0) { + if (features[12] <= 45.0) { + if (features[7] <= 202.5) { + if (features[15] <= 10.0) { + if (features[3] <= 1.5) { + if (features[2] <= 21.5) { + if (features[15] <= 0.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[16] <= 3.5) { + if (features[9] <= 15.5) { + if (features[1] <= 93.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 14; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 0; + classes[1] = 33; + } + } else { + if (features[15] <= 4.5) { + classes[0] = 0; + classes[1] = 18; + } else { + if (features[7] <= 85.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[4] <= 46.5) { + if (features[7] <= 212.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + if (features[4] <= 828.0) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[17] <= 0.5) { + if (features[1] <= 238.0) { + if (features[8] <= 2.0) { + if (features[12] <= 5.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[7] <= 66.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[9] <= 110.0) { + if (features[2] <= 12.0) { + if (features[0] <= 9.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[14] <= 23.5) { + classes[0] = 10; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } + } else { + if (features[17] <= 0.5) { + if (features[8] <= 25.5) { + if (features[4] <= 602.5) { + if (features[1] <= 281.0) { + if (features[12] <= 42.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 30; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[0] <= 38.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[12] <= 131.5) { + classes[0] = 0; + classes[1] = 20; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[2] <= 47.0) { + if (features[2] <= 13.5) { + if (features[9] <= 8.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 12; + } + } else { + classes[0] = 0; + classes[1] = 69; + } + } else { + if (features[7] <= 295.5) { + if (features[15] <= 4.5) { + if (features[2] <= 61.0) { + classes[0] = 0; + classes[1] = 12; + } else { + if (features[12] <= 9.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[2] <= 75.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } else { + if (features[3] <= 0.5) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } + } else { + if (features[1] <= 12.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[1] <= 367.5) { + if (features[9] <= 5.5) { + if (features[2] <= 30.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[4] <= 36.0) { + if (features[1] <= 26.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[0] <= 2.5) { + if (features[17] <= 0.5) { + if (features[1] <= 143.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[17] <= 0.5) { + if (features[12] <= 42.5) { + if (features[9] <= 24.0) { + if (features[7] <= 91.0) { + classes[0] = 0; + classes[1] = 9; + } else { + if (features[2] <= 54.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 21; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 55; + } + } + } + } else { + classes[0] = 0; + classes[1] = 60; + } + } + } else { + if (features[9] <= 38.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_14(float features[]) { + int classes[2]; + + if (features[17] <= 0.5) { + if (features[12] <= 2.5) { + if (features[4] <= 39.0) { + if (features[7] <= 83.0) { + if (features[7] <= 32.5) { + if (features[14] <= 0.5) { + if (features[6] <= 0.5) { + if (features[12] <= 0.5) { + if (features[0] <= 0.5) { + if (features[9] <= 0.5) { + if (features[1] <= 0.5) { + if (features[18] <= 0.5) { + classes[0] = 81; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + classes[0] = 39; + classes[1] = 0; + } + } else { + classes[0] = 92; + classes[1] = 0; + } + } else { + classes[0] = 32; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + if (features[1] <= 15.5) { + if (features[7] <= 35.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + classes[0] = 44; + classes[1] = 0; + } + } + } else { + if (features[14] <= 0.5) { + if (features[9] <= 35.0) { + if (features[13] <= 0.5) { + if (features[12] <= 0.5) { + if (features[2] <= 16.0) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[2] <= 22.5) { + if (features[9] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 30; + classes[1] = 0; + } + } else { + classes[0] = 16; + classes[1] = 0; + } + } else { + if (features[0] <= 20.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[7] <= 82.0) { + if (features[4] <= 116.0) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[7] <= 40.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[3] <= 0.5) { + if (features[7] <= 214.5) { + if (features[2] <= 30.5) { + if (features[16] <= 3.5) { + if (features[15] <= 0.5) { + if (features[9] <= 15.5) { + if (features[16] <= 0.5) { + classes[0] = 114; + classes[1] = 0; + } else { + if (features[12] <= 4.5) { + if (features[2] <= 26.5) { + if (features[7] <= 157.5) { + if (features[0] <= 3.5) { + if (features[12] <= 3.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[2] <= 9.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 19; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 67; + classes[1] = 0; + } + } + } else { + if (features[0] <= 23.0) { + if (features[8] <= 0.5) { + if (features[9] <= 16.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[6] <= 0.5) { + if (features[0] <= 18.0) { + if (features[5] <= 0.5) { + if (features[7] <= 187.5) { + classes[0] = 24; + classes[1] = 0; + } else { + if (features[12] <= 7.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[14] <= 6.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[11] <= 4.5) { + if (features[2] <= 19.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[7] <= 181.5) { + if (features[2] <= 23.0) { + if (features[9] <= 22.0) { + if (features[1] <= 189.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[9] <= 94.5) { + classes[0] = 31; + classes[1] = 0; + } else { + if (features[7] <= 157.0) { + if (features[9] <= 108.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } else { + if (features[16] <= 2.5) { + if (features[16] <= 1.5) { + classes[0] = 153; + classes[1] = 0; + } else { + if (features[6] <= 1.5) { + if (features[18] <= 0.5) { + if (features[13] <= 0.5) { + if (features[7] <= 60.0) { + classes[0] = 12; + classes[1] = 0; + } else { + if (features[5] <= 0.5) { + if (features[9] <= 12.5) { + if (features[9] <= 10.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[2] <= 11.5) { + if (features[1] <= 134.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + if (features[7] <= 96.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[11] <= 0.5) { + if (features[15] <= 4.5) { + if (features[0] <= 19.5) { + if (features[1] <= 47.0) { + if (features[15] <= 1.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[15] <= 13.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } else { + if (features[5] <= 0.5) { + if (features[14] <= 0.5) { + if (features[16] <= 4.5) { + if (features[6] <= 0.5) { + if (features[1] <= 116.5) { + if (features[13] <= 0.5) { + if (features[0] <= 11.5) { + classes[0] = 0; + classes[1] = 11; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } else { + if (features[6] <= 2.5) { + classes[0] = 0; + classes[1] = 19; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[1] <= 143.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[14] <= 0.5) { + if (features[12] <= 5.5) { + if (features[0] <= 10.0) { + if (features[1] <= 49.5) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + if (features[16] <= 2.5) { + if (features[7] <= 93.0) { + if (features[1] <= 169.0) { + classes[0] = 18; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 56; + classes[1] = 0; + } + } else { + if (features[2] <= 34.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[2] <= 59.5) { + if (features[0] <= 4.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 10; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } + } else { + if (features[14] <= 8.5) { + if (features[12] <= 13.5) { + if (features[15] <= 11.0) { + classes[0] = 0; + classes[1] = 26; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[1] <= 87.0) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[2] <= 53.0) { + if (features[15] <= 8.0) { + if (features[11] <= 0.5) { + if (features[9] <= 39.0) { + classes[0] = 0; + classes[1] = 11; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[7] <= 167.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + classes[0] = 15; + classes[1] = 0; + } + } + } + } else { + if (features[9] <= 12.5) { + if (features[16] <= 3.5) { + classes[0] = 177; + classes[1] = 0; + } else { + if (features[9] <= 4.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + if (features[9] <= 15.5) { + if (features[16] <= 1.5) { + classes[0] = 13; + classes[1] = 0; + } else { + if (features[7] <= 261.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[12] <= 20.0) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[13] <= 0.5) { + if (features[16] <= 2.5) { + if (features[2] <= 39.5) { + classes[0] = 101; + classes[1] = 0; + } else { + if (features[0] <= 29.0) { + if (features[14] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 25; + classes[1] = 0; + } + } + } else { + if (features[8] <= 2.0) { + if (features[15] <= 3.5) { + if (features[18] <= 0.5) { + if (features[12] <= 15.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[9] <= 28.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[2] <= 37.0) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[1] <= 196.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + if (features[14] <= 22.5) { + classes[0] = 67; + classes[1] = 0; + } else { + if (features[1] <= 429.0) { + if (features[16] <= 3.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } + } + } else { + if (features[9] <= 17.5) { + if (features[0] <= 1.5) { + if (features[4] <= 89.0) { + if (features[16] <= 2.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } else { + if (features[7] <= 437.5) { + if (features[9] <= 6.5) { + classes[0] = 31; + classes[1] = 0; + } else { + if (features[2] <= 14.5) { + if (features[7] <= 52.5) { + if (features[16] <= 1.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[11] <= 2.0) { + if (features[1] <= 57.5) { + if (features[0] <= 3.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 41; + classes[1] = 0; + } + } else { + if (features[7] <= 153.0) { + if (features[15] <= 1.0) { + classes[0] = 0; + classes[1] = 7; + } else { + if (features[1] <= 110.0) { + if (features[18] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[8] <= 1.0) { + if (features[1] <= 87.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 12; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } + } else { + if (features[16] <= 2.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[12] <= 19.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } + } else { + if (features[0] <= 17.5) { + if (features[1] <= 175.0) { + if (features[1] <= 29.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[12] <= 17.0) { + if (features[0] <= 3.5) { + if (features[16] <= 4.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[16] <= 1.5) { + if (features[8] <= 2.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[12] <= 10.5) { + if (features[15] <= 3.0) { + classes[0] = 0; + classes[1] = 26; + } else { + if (features[9] <= 23.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[0] <= 6.0) { + if (features[14] <= 5.5) { + if (features[1] <= 84.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[4] <= 91.0) { + classes[0] = 0; + classes[1] = 8; + } else { + if (features[16] <= 4.5) { + if (features[5] <= 1.5) { + if (features[7] <= 129.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } + } + } else { + if (features[7] <= 168.0) { + classes[0] = 0; + classes[1] = 42; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[9] <= 97.0) { + if (features[7] <= 288.5) { + if (features[0] <= 8.5) { + if (features[16] <= 3.5) { + classes[0] = 20; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[15] <= 0.5) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + if (features[14] <= 2.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[12] <= 42.0) { + if (features[4] <= 304.5) { + if (features[1] <= 266.0) { + if (features[7] <= 161.5) { + if (features[4] <= 164.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 14; + classes[1] = 0; + } + } else { + if (features[6] <= 3.0) { + if (features[8] <= 3.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[9] <= 88.0) { + if (features[3] <= 22.0) { + if (features[8] <= 1.5) { + if (features[15] <= 3.0) { + classes[0] = 0; + classes[1] = 12; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[0] <= 23.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } else { + classes[0] = 18; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[0] <= 0.5) { + if (features[14] <= 7.0) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[9] <= 5.0) { + if (features[16] <= 1.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[12] <= 13.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[1] <= 442.0) { + if (features[12] <= 33.0) { + if (features[9] <= 58.0) { + if (features[1] <= 61.5) { + if (features[14] <= 2.5) { + classes[0] = 0; + classes[1] = 29; + } else { + if (features[15] <= 7.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 181; + } + } else { + if (features[9] <= 60.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 11; + } + } + } else { + if (features[12] <= 34.5) { + if (features[16] <= 3.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 12; + } + } + } else { + if (features[16] <= 2.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_15(float features[]) { + int classes[2]; + + if (features[4] <= 18.5) { + if (features[18] <= 0.5) { + if (features[9] <= 13.5) { + if (features[12] <= 2.5) { + if (features[7] <= 32.5) { + classes[0] = 221; + classes[1] = 0; + } else { + if (features[12] <= 1.5) { + if (features[7] <= 34.0) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[0] <= 6.0) { + if (features[16] <= 4.0) { + classes[0] = 18; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 37; + classes[1] = 0; + } + } + } else { + classes[0] = 26; + classes[1] = 0; + } + } + } else { + if (features[11] <= 1.5) { + if (features[15] <= 2.5) { + if (features[0] <= 58.0) { + if (features[17] <= 0.5) { + if (features[16] <= 1.5) { + if (features[0] <= 15.5) { + classes[0] = 118; + classes[1] = 0; + } else { + if (features[13] <= 1.5) { + classes[0] = 65; + classes[1] = 0; + } else { + if (features[9] <= 11.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[6] <= 0.5) { + if (features[1] <= 83.5) { + if (features[0] <= 20.5) { + if (features[13] <= 0.5) { + if (features[7] <= 156.0) { + if (features[7] <= 58.5) { + if (features[1] <= 56.5) { + if (features[9] <= 2.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + if (features[11] <= 0.5) { + if (features[12] <= 9.5) { + if (features[0] <= 9.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[12] <= 5.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + if (features[12] <= 8.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[1] <= 371.0) { + if (features[13] <= 2.5) { + if (features[13] <= 1.5) { + if (features[12] <= 13.5) { + classes[0] = 25; + classes[1] = 0; + } else { + if (features[0] <= 11.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[15] <= 1.5) { + if (features[2] <= 30.0) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[9] <= 4.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } else { + if (features[1] <= 193.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[1] <= 316.5) { + if (features[14] <= 0.5) { + if (features[16] <= 3.0) { + classes[0] = 10; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 9; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 17; + classes[1] = 0; + } + } + } else { + if (features[2] <= 11.0) { + if (features[12] <= 6.5) { + if (features[12] <= 4.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 18; + classes[1] = 0; + } + } else { + classes[0] = 84; + classes[1] = 0; + } + } + } else { + classes[0] = 67; + classes[1] = 0; + } + } + } else { + if (features[7] <= 111.5) { + if (features[14] <= 4.5) { + if (features[17] <= 0.5) { + if (features[0] <= 14.5) { + if (features[14] <= 0.5) { + if (features[3] <= 0.5) { + if (features[2] <= 13.5) { + if (features[16] <= 2.5) { + classes[0] = 27; + classes[1] = 0; + } else { + if (features[15] <= 0.5) { + classes[0] = 0; + classes[1] = 7; + } else { + if (features[7] <= 15.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + if (features[0] <= 3.5) { + if (features[1] <= 48.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[16] <= 1.0) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[16] <= 2.5) { + if (features[2] <= 17.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[1] <= 56.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 20; + } + } + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[16] <= 1.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[1] <= 47.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 34; + } + } + } + } else { + if (features[2] <= 24.5) { + if (features[16] <= 2.5) { + classes[0] = 43; + classes[1] = 0; + } else { + if (features[11] <= 1.0) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[16] <= 1.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[6] <= 14.5) { + classes[0] = 0; + classes[1] = 11; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 15; + } + } else { + if (features[7] <= 75.5) { + classes[0] = 14; + classes[1] = 0; + } else { + if (features[0] <= 12.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } + } else { + if (features[1] <= 123.0) { + if (features[2] <= 20.5) { + if (features[11] <= 3.0) { + if (features[1] <= 76.0) { + classes[0] = 21; + classes[1] = 0; + } else { + if (features[7] <= 120.0) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[0] <= 8.5) { + classes[0] = 11; + classes[1] = 0; + } else { + if (features[0] <= 21.5) { + if (features[7] <= 204.0) { + if (features[1] <= 104.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 11; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[0] <= 19.5) { + classes[0] = 0; + classes[1] = 17; + } else { + if (features[11] <= 1.5) { + if (features[16] <= 2.5) { + classes[0] = 14; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[5] <= 0.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[16] <= 2.5) { + if (features[16] <= 1.5) { + classes[0] = 176; + classes[1] = 0; + } else { + if (features[17] <= 0.5) { + if (features[8] <= 3.5) { + classes[0] = 19; + classes[1] = 0; + } else { + if (features[2] <= 54.5) { + if (features[11] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[14] <= 16.0) { + if (features[7] <= 276.0) { + if (features[1] <= 254.0) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 15; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } + } else { + if (features[17] <= 0.5) { + if (features[1] <= 145.5) { + if (features[9] <= 8.0) { + if (features[16] <= 1.5) { + classes[0] = 31; + classes[1] = 0; + } else { + if (features[15] <= 3.5) { + if (features[0] <= 0.5) { + if (features[9] <= 1.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[14] <= 18.5) { + if (features[12] <= 12.5) { + if (features[2] <= 48.5) { + if (features[7] <= 59.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[12] <= 27.5) { + if (features[13] <= 0.5) { + classes[0] = 0; + classes[1] = 21; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + if (features[5] <= 0.5) { + if (features[15] <= 0.5) { + if (features[16] <= 1.5) { + classes[0] = 42; + classes[1] = 0; + } else { + if (features[7] <= 204.0) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[16] <= 3.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 3.5) { + classes[0] = 87; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[6] <= 0.5) { + if (features[7] <= 235.0) { + if (features[9] <= 23.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } else { + if (features[14] <= 78.5) { + if (features[8] <= 0.5) { + if (features[1] <= 293.0) { + if (features[1] <= 19.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[7] <= 311.0) { + if (features[14] <= 3.0) { + if (features[0] <= 0.5) { + if (features[15] <= 1.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 82; + } + } else { + classes[0] = 0; + classes[1] = 32; + } + } else { + if (features[0] <= 34.0) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[14] <= 5.5) { + if (features[16] <= 1.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[7] <= 396.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 22; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + if (features[14] <= 0.5) { + if (features[0] <= 17.5) { + if (features[4] <= 246.0) { + if (features[2] <= 2.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[13] <= 0.5) { + if (features[15] <= 10.5) { + if (features[2] <= 38.0) { + if (features[2] <= 29.5) { + if (features[7] <= 49.5) { + if (features[4] <= 196.5) { + if (features[8] <= 0.5) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[0] <= 2.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } else { + if (features[16] <= 5.0) { + if (features[12] <= 4.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[7] <= 405.5) { + if (features[15] <= 5.0) { + classes[0] = 0; + classes[1] = 11; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[12] <= 16.0) { + if (features[0] <= 9.0) { + if (features[4] <= 102.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 13; + classes[1] = 0; + } + } + } + } else { + if (features[12] <= 7.5) { + if (features[1] <= 60.5) { + if (features[0] <= 1.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 9; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + if (features[3] <= 1.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[8] <= 3.5) { + classes[0] = 0; + classes[1] = 35; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[3] <= 3.5) { + if (features[16] <= 4.5) { + if (features[2] <= 70.0) { + if (features[1] <= 194.5) { + classes[0] = 27; + classes[1] = 0; + } else { + if (features[16] <= 1.5) { + classes[0] = 14; + classes[1] = 0; + } else { + if (features[12] <= 40.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[2] <= 18.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[1] <= 284.0) { + if (features[9] <= 17.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[12] <= 8.5) { + if (features[16] <= 3.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[9] <= 340.5) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[0] <= 20.5) { + if (features[6] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } + } + } + } else { + if (features[17] <= 0.5) { + if (features[2] <= 13.5) { + if (features[7] <= 64.5) { + if (features[7] <= 24.0) { + if (features[6] <= 0.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + if (features[4] <= 93.0) { + if (features[12] <= 19.5) { + if (features[0] <= 6.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[1] <= 305.0) { + classes[0] = 36; + classes[1] = 0; + } else { + if (features[8] <= 4.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[0] <= 10.0) { + classes[0] = 12; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } + } else { + if (features[1] <= 28.0) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[9] <= 7.5) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[16] <= 0.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[7] <= 130.0) { + if (features[11] <= 1.5) { + if (features[15] <= 4.5) { + classes[0] = 0; + classes[1] = 56; + } else { + if (features[12] <= 17.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[7] <= 80.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[7] <= 241.5) { + if (features[3] <= 2.5) { + if (features[11] <= 0.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[0] <= 14.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + if (features[1] <= 459.5) { + classes[0] = 0; + classes[1] = 15; + } else { + if (features[16] <= 5.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 67; + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_16(float features[]) { + int classes[2]; + + if (features[1] <= 24.5) { + if (features[16] <= 5.5) { + if (features[14] <= 0.5) { + if (features[16] <= 2.5) { + if (features[3] <= 1.5) { + classes[0] = 261; + classes[1] = 0; + } else { + if (features[4] <= 196.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + if (features[1] <= 10.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[18] <= 0.5) { + if (features[2] <= 25.5) { + classes[0] = 17; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[17] <= 0.5) { + if (features[5] <= 0.5) { + if (features[12] <= 32.5) { + if (features[11] <= 3.5) { + if (features[14] <= 0.5) { + if (features[9] <= 13.5) { + if (features[4] <= 166.0) { + if (features[1] <= 80.5) { + if (features[16] <= 1.5) { + if (features[16] <= 0.5) { + classes[0] = 94; + classes[1] = 0; + } else { + if (features[7] <= 7.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 35; + classes[1] = 0; + } + } + } else { + if (features[9] <= 11.5) { + if (features[9] <= 0.5) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[7] <= 17.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[1] <= 53.5) { + if (features[0] <= 17.5) { + classes[0] = 14; + classes[1] = 0; + } else { + if (features[12] <= 3.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[2] <= 17.5) { + classes[0] = 8; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[12] <= 19.5) { + classes[0] = 187; + classes[1] = 0; + } else { + if (features[0] <= 5.5) { + if (features[3] <= 0.5) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[2] <= 34.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[15] <= 13.5) { + classes[0] = 50; + classes[1] = 0; + } else { + if (features[12] <= 26.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[1] <= 133.0) { + if (features[0] <= 18.0) { + if (features[7] <= 94.0) { + if (features[9] <= 7.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[1] <= 126.5) { + if (features[0] <= 18.0) { + if (features[0] <= 8.5) { + if (features[2] <= 19.5) { + if (features[1] <= 92.5) { + if (features[16] <= 1.5) { + if (features[3] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[7] <= 61.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[2] <= 5.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[15] <= 1.5) { + if (features[2] <= 9.5) { + if (features[4] <= 162.0) { + if (features[4] <= 45.0) { + if (features[16] <= 3.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[4] <= 43.0) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } + } else { + if (features[0] <= 2.5) { + if (features[16] <= 2.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } else { + if (features[12] <= 28.0) { + if (features[12] <= 13.0) { + classes[0] = 0; + classes[1] = 22; + } else { + if (features[9] <= 16.0) { + if (features[0] <= 3.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 11; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[0] <= 12.5) { + if (features[1] <= 118.0) { + if (features[7] <= 83.5) { + if (features[4] <= 260.0) { + if (features[16] <= 1.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[1] <= 103.5) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[4] <= 85.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[1] <= 49.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[3] <= 0.5) { + if (features[16] <= 0.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[15] <= 2.5) { + if (features[9] <= 18.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[13] <= 1.5) { + if (features[9] <= 26.0) { + if (features[12] <= 17.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } + } + } else { + if (features[16] <= 4.5) { + if (features[0] <= 55.0) { + classes[0] = 36; + classes[1] = 0; + } else { + if (features[1] <= 98.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[15] <= 4.0) { + if (features[4] <= 508.0) { + if (features[16] <= 2.5) { + if (features[16] <= 1.5) { + classes[0] = 86; + classes[1] = 0; + } else { + if (features[12] <= 26.5) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[9] <= 84.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[1] <= 174.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[7] <= 249.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[0] <= 5.0) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[12] <= 9.0) { + if (features[0] <= 55.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[12] <= 23.0) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 36; + classes[1] = 0; + } + } + } + } else { + if (features[0] <= 24.5) { + if (features[15] <= 5.5) { + if (features[16] <= 1.5) { + if (features[4] <= 173.5) { + if (features[16] <= 0.5) { + classes[0] = 40; + classes[1] = 0; + } else { + if (features[7] <= 216.0) { + if (features[14] <= 2.0) { + if (features[12] <= 4.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[2] <= 7.5) { + if (features[13] <= 0.5) { + if (features[12] <= 13.5) { + if (features[1] <= 54.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[2] <= 6.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[0] <= 5.5) { + if (features[1] <= 30.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[14] <= 3.5) { + if (features[6] <= 0.5) { + if (features[15] <= 0.5) { + if (features[16] <= 2.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[7] <= 259.5) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 12; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[9] <= 15.5) { + if (features[14] <= 7.5) { + if (features[11] <= 1.0) { + if (features[12] <= 27.5) { + if (features[4] <= 237.5) { + if (features[8] <= 6.5) { + if (features[7] <= 280.0) { + if (features[14] <= 1.5) { + if (features[2] <= 28.0) { + if (features[9] <= 14.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 0; + classes[1] = 13; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[8] <= 0.5) { + if (features[11] <= 0.5) { + if (features[2] <= 61.0) { + classes[0] = 0; + classes[1] = 51; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[2] <= 24.0) { + classes[0] = 0; + classes[1] = 7; + } else { + if (features[1] <= 106.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[4] <= 138.0) { + if (features[16] <= 2.5) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[7] <= 160.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } + } + } else { + if (features[7] <= 86.0) { + if (features[1] <= 154.5) { + classes[0] = 29; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[0] <= 9.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[2] <= 20.5) { + if (features[15] <= 12.0) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[0] <= 13.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } + } + } else { + if (features[16] <= 2.5) { + if (features[14] <= 2.0) { + if (features[7] <= 95.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[1] <= 155.0) { + if (features[7] <= 328.0) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 12; + classes[1] = 0; + } + } + } else { + classes[0] = 72; + classes[1] = 0; + } + } else { + if (features[7] <= 145.5) { + if (features[9] <= 30.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[0] <= 57.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } + } + } else { + if (features[16] <= 5.0) { + if (features[16] <= 2.5) { + classes[0] = 84; + classes[1] = 0; + } else { + if (features[9] <= 19.0) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[2] <= 13.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[4] <= 283.0) { + if (features[7] <= 118.0) { + if (features[16] <= 2.5) { + if (features[4] <= 38.5) { + classes[0] = 20; + classes[1] = 0; + } else { + if (features[13] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[15] <= 6.0) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[16] <= 2.5) { + if (features[15] <= 0.5) { + if (features[11] <= 0.5) { + if (features[0] <= 8.0) { + if (features[9] <= 128.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 56; + classes[1] = 0; + } + } else { + classes[0] = 18; + classes[1] = 0; + } + } else { + classes[0] = 118; + classes[1] = 0; + } + } else { + if (features[0] <= 9.0) { + if (features[2] <= 61.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 15; + classes[1] = 0; + } + } + } + } else { + if (features[0] <= 15.5) { + if (features[12] <= 115.0) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[7] <= 147.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[8] <= 22.0) { + if (features[8] <= 0.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[1] <= 312.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[7] <= 128.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[4] <= 503.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[16] <= 5.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[2] <= 38.5) { + if (features[1] <= 57.5) { + if (features[15] <= 0.5) { + if (features[3] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } else { + if (features[4] <= 279.0) { + if (features[18] <= 0.5) { + if (features[6] <= 0.5) { + if (features[12] <= 12.5) { + classes[0] = 20; + classes[1] = 0; + } else { + if (features[12] <= 14.0) { + if (features[3] <= 1.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + if (features[12] <= 11.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 11; + classes[1] = 0; + } + } + } else { + if (features[0] <= 55.5) { + if (features[9] <= 7.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[6] <= 3.5) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } + } else { + if (features[2] <= 39.5) { + classes[0] = 0; + classes[1] = 7; + } else { + if (features[14] <= 2.0) { + if (features[2] <= 43.0) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[7] <= 583.5) { + classes[0] = 0; + classes[1] = 13; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } + } + } else { + if (features[8] <= 46.0) { + if (features[16] <= 0.5) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[0] <= 0.5) { + if (features[15] <= 1.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[1] <= 193.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[1] <= 430.5) { + if (features[11] <= 0.5) { + if (features[9] <= 1.5) { + if (features[0] <= 12.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[0] <= 11.5) { + if (features[0] <= 8.5) { + classes[0] = 0; + classes[1] = 74; + } else { + if (features[7] <= 82.5) { + if (features[15] <= 7.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[2] <= 65.5) { + classes[0] = 0; + classes[1] = 22; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 133; + } + } + } else { + if (features[7] <= 168.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[14] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[5] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_17(float features[]) { + int classes[2]; + + if (features[16] <= 1.5) { + if (features[4] <= 178.0) { + if (features[17] <= 0.5) { + if (features[9] <= 11.5) { + if (features[2] <= 11.5) { + if (features[1] <= 434.0) { + classes[0] = 293; + classes[1] = 0; + } else { + if (features[16] <= 0.5) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 357; + classes[1] = 0; + } + } else { + if (features[7] <= 88.5) { + if (features[7] <= 87.0) { + if (features[2] <= 32.5) { + classes[0] = 83; + classes[1] = 0; + } else { + if (features[7] <= 75.0) { + if (features[0] <= 24.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[8] <= 0.5) { + classes[0] = 345; + classes[1] = 0; + } else { + if (features[16] <= 0.5) { + classes[0] = 52; + classes[1] = 0; + } else { + if (features[1] <= 95.5) { + if (features[12] <= 5.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[12] <= 17.5) { + if (features[1] <= 22.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 31; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 23; + classes[1] = 0; + } else { + if (features[18] <= 0.5) { + if (features[3] <= 1.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[9] <= 52.5) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + if (features[7] <= 21.5) { + if (features[12] <= 7.5) { + classes[0] = 53; + classes[1] = 0; + } else { + if (features[4] <= 223.0) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[14] <= 0.5) { + if (features[0] <= 15.5) { + if (features[7] <= 183.0) { + if (features[13] <= 0.5) { + if (features[12] <= 11.5) { + if (features[4] <= 214.5) { + if (features[7] <= 55.5) { + if (features[5] <= 0.5) { + if (features[12] <= 2.5) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[15] <= 2.0) { + if (features[9] <= 17.0) { + if (features[0] <= 9.5) { + classes[0] = 14; + classes[1] = 0; + } else { + if (features[2] <= 11.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[0] <= 5.0) { + if (features[4] <= 151.5) { + if (features[7] <= 30.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[6] <= 2.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[9] <= 6.0) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[0] <= 3.5) { + classes[0] = 0; + classes[1] = 11; + } else { + if (features[9] <= 17.5) { + if (features[7] <= 61.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[18] <= 0.5) { + if (features[3] <= 1.0) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 15; + } + } else { + if (features[9] <= 5.5) { + if (features[15] <= 0.5) { + if (features[1] <= 236.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + if (features[9] <= 37.5) { + if (features[15] <= 1.5) { + classes[0] = 0; + classes[1] = 55; + } else { + if (features[3] <= 0.5) { + if (features[0] <= 7.0) { + if (features[11] <= 0.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[9] <= 40.5) { + if (features[16] <= 3.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[8] <= 38.5) { + classes[0] = 0; + classes[1] = 11; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[3] <= 2.5) { + if (features[8] <= 0.5) { + classes[0] = 21; + classes[1] = 0; + } else { + if (features[9] <= 24.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[17] <= 0.5) { + if (features[16] <= 5.5) { + if (features[3] <= 0.5) { + if (features[7] <= 265.5) { + if (features[2] <= 25.0) { + classes[0] = 11; + classes[1] = 0; + } else { + if (features[2] <= 33.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[7] <= 280.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[3] <= 0.5) { + if (features[18] <= 0.5) { + if (features[11] <= 2.5) { + if (features[2] <= 31.5) { + if (features[9] <= 12.5) { + if (features[0] <= 28.0) { + if (features[16] <= 2.5) { + if (features[15] <= 0.5) { + if (features[12] <= 5.0) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[2] <= 14.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 15; + classes[1] = 0; + } + } else { + classes[0] = 22; + classes[1] = 0; + } + } else { + if (features[13] <= 0.5) { + if (features[7] <= 425.0) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[8] <= 6.5) { + if (features[0] <= 61.0) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + classes[0] = 15; + classes[1] = 0; + } + } else { + if (features[7] <= 220.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 8; + } + } + } else { + if (features[12] <= 55.5) { + if (features[18] <= 0.5) { + if (features[3] <= 2.5) { + if (features[16] <= 4.5) { + if (features[7] <= 120.0) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[9] <= 3.5) { + if (features[5] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[2] <= 61.5) { + classes[0] = 12; + classes[1] = 0; + } else { + if (features[4] <= 95.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[16] <= 2.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[15] <= 0.5) { + if (features[0] <= 23.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } else { + if (features[17] <= 0.5) { + if (features[0] <= 3.5) { + if (features[7] <= 56.0) { + if (features[4] <= 564.0) { + classes[0] = 14; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[12] <= 20.5) { + if (features[2] <= 8.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[0] <= 2.5) { + if (features[1] <= 48.5) { + if (features[9] <= 15.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[15] <= 6.0) { + if (features[12] <= 38.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + if (features[12] <= 42.5) { + if (features[18] <= 0.5) { + if (features[4] <= 234.0) { + if (features[9] <= 12.5) { + if (features[12] <= 2.0) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[7] <= 53.0) { + if (features[9] <= 7.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[0] <= 10.0) { + classes[0] = 13; + classes[1] = 0; + } else { + if (features[14] <= 2.0) { + if (features[4] <= 71.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 11; + classes[1] = 0; + } + } + } + } + } else { + if (features[1] <= 54.5) { + classes[0] = 0; + classes[1] = 18; + } else { + if (features[11] <= 1.5) { + if (features[12] <= 18.5) { + if (features[2] <= 9.5) { + if (features[14] <= 10.5) { + classes[0] = 8; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[12] <= 9.5) { + if (features[7] <= 96.5) { + if (features[7] <= 91.0) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } else { + if (features[3] <= 0.5) { + if (features[14] <= 4.0) { + if (features[5] <= 0.5) { + if (features[9] <= 24.0) { + if (features[7] <= 122.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[1] <= 106.5) { + if (features[15] <= 1.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[9] <= 28.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } + } else { + if (features[7] <= 208.0) { + if (features[9] <= 15.5) { + if (features[7] <= 42.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 34; + } + } else { + if (features[4] <= 70.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + if (features[15] <= 3.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } + } + } else { + if (features[2] <= 44.5) { + if (features[16] <= 2.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[12] <= 38.0) { + classes[0] = 0; + classes[1] = 31; + } else { + if (features[7] <= 414.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[14] <= 2.0) { + if (features[1] <= 80.0) { + if (features[16] <= 3.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 12; + } + } else { + classes[0] = 0; + classes[1] = 16; + } + } + } else { + if (features[16] <= 3.5) { + if (features[0] <= 8.5) { + if (features[7] <= 254.0) { + classes[0] = 21; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[12] <= 52.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[9] <= 134.0) { + classes[0] = 0; + classes[1] = 11; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[0] <= 15.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 20; + classes[1] = 0; + } + } + } + } + } else { + if (features[1] <= 426.5) { + if (features[0] <= 0.5) { + if (features[18] <= 0.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[12] <= 28.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[1] <= 80.5) { + if (features[12] <= 11.5) { + classes[0] = 0; + classes[1] = 39; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[8] <= 0.5) { + classes[0] = 0; + classes[1] = 123; + } else { + if (features[16] <= 2.5) { + if (features[7] <= 237.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 17; + } + } + } + } + } else { + if (features[12] <= 54.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_18(float features[]) { + int classes[2]; + + if (features[9] <= 11.5) { + if (features[1] <= 28.5) { + if (features[4] <= 146.0) { + if (features[7] <= 32.5) { + classes[0] = 250; + classes[1] = 0; + } else { + if (features[7] <= 35.0) { + if (features[9] <= 5.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 34; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[3] <= 0.5) { + if (features[17] <= 0.5) { + if (features[16] <= 1.5) { + if (features[15] <= 0.5) { + if (features[7] <= 6.0) { + if (features[7] <= 4.5) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 260; + classes[1] = 0; + } + } else { + classes[0] = 166; + classes[1] = 0; + } + } else { + if (features[2] <= 27.5) { + if (features[2] <= 2.0) { + if (features[9] <= 1.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[12] <= 5.5) { + if (features[0] <= 24.0) { + if (features[7] <= 115.5) { + if (features[7] <= 16.0) { + if (features[1] <= 32.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[15] <= 0.5) { + classes[0] = 12; + classes[1] = 0; + } else { + if (features[9] <= 7.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[11] <= 0.5) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 13; + classes[1] = 0; + } + } else { + if (features[12] <= 77.0) { + classes[0] = 66; + classes[1] = 0; + } else { + if (features[2] <= 13.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } + } else { + if (features[14] <= 0.5) { + if (features[13] <= 3.5) { + if (features[12] <= 3.5) { + if (features[1] <= 67.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[1] <= 251.0) { + if (features[2] <= 37.0) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[15] <= 0.5) { + if (features[1] <= 168.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } else { + if (features[12] <= 23.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[7] <= 179.5) { + classes[0] = 0; + classes[1] = 8; + } else { + if (features[12] <= 20.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[0] <= 99.5) { + if (features[14] <= 21.5) { + if (features[1] <= 280.0) { + if (features[12] <= 16.5) { + if (features[2] <= 65.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[9] <= 6.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[16] <= 3.5) { + if (features[0] <= 13.5) { + if (features[17] <= 0.5) { + if (features[4] <= 49.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[12] <= 3.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[2] <= 16.0) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[13] <= 2.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[2] <= 27.0) { + classes[0] = 14; + classes[1] = 0; + } else { + if (features[18] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[1] <= 165.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[7] <= 487.0) { + if (features[2] <= 3.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[4] <= 46.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[2] <= 15.0) { + if (features[0] <= 1.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[7] <= 71.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 12; + } + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } else { + if (features[3] <= 2.5) { + if (features[16] <= 0.5) { + classes[0] = 423; + classes[1] = 0; + } else { + if (features[17] <= 0.5) { + if (features[0] <= 18.5) { + if (features[4] <= 96.5) { + if (features[16] <= 2.5) { + if (features[2] <= 20.0) { + if (features[0] <= 3.5) { + classes[0] = 11; + classes[1] = 0; + } else { + if (features[12] <= 4.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[8] <= 0.5) { + if (features[5] <= 0.5) { + if (features[0] <= 16.5) { + if (features[4] <= 12.0) { + if (features[12] <= 11.0) { + if (features[7] <= 169.0) { + if (features[7] <= 100.0) { + if (features[0] <= 7.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[5] <= 7.0) { + if (features[9] <= 16.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 8; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[13] <= 2.0) { + if (features[11] <= 0.5) { + if (features[14] <= 0.5) { + if (features[7] <= 61.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[4] <= 39.0) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[4] <= 36.5) { + if (features[15] <= 5.5) { + classes[0] = 0; + classes[1] = 12; + } else { + if (features[1] <= 92.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 12; + } + } + } else { + if (features[0] <= 7.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[1] <= 106.0) { + if (features[8] <= 1.5) { + if (features[7] <= 54.5) { + if (features[9] <= 13.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 23; + } + } else { + classes[0] = 0; + classes[1] = 44; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[9] <= 46.5) { + if (features[8] <= 0.5) { + if (features[0] <= 4.5) { + if (features[12] <= 9.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 12; + } + } else { + if (features[0] <= 10.5) { + classes[0] = 0; + classes[1] = 15; + } else { + if (features[0] <= 11.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[12] <= 7.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 21; + } + } + } + } + } else { + if (features[3] <= 0.5) { + if (features[5] <= 1.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[2] <= 15.0) { + if (features[15] <= 0.5) { + if (features[1] <= 40.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[2] <= 6.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[13] <= 1.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 33; + classes[1] = 0; + } + } else { + if (features[12] <= 26.5) { + if (features[9] <= 50.5) { + if (features[14] <= 0.5) { + classes[0] = 0; + classes[1] = 8; + } else { + if (features[5] <= 1.0) { + if (features[15] <= 3.0) { + if (features[4] <= 176.5) { + if (features[8] <= 1.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[8] <= 0.5) { + classes[0] = 0; + classes[1] = 8; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } + } else { + if (features[18] <= 0.5) { + if (features[12] <= 4.5) { + classes[0] = 28; + classes[1] = 0; + } else { + if (features[1] <= 89.0) { + if (features[14] <= 0.5) { + if (features[9] <= 12.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[6] <= 3.0) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } else { + if (features[0] <= 59.0) { + if (features[3] <= 1.5) { + if (features[14] <= 0.5) { + if (features[7] <= 580.5) { + if (features[11] <= 0.5) { + if (features[12] <= 46.0) { + classes[0] = 29; + classes[1] = 0; + } else { + if (features[12] <= 50.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[9] <= 35.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[9] <= 27.0) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[0] <= 46.5) { + if (features[2] <= 32.0) { + if (features[6] <= 12.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 2.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[15] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + if (features[2] <= 14.5) { + if (features[15] <= 2.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 14; + classes[1] = 0; + } + } + } + } + } else { + if (features[1] <= 91.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[14] <= 0.5) { + if (features[15] <= 1.5) { + if (features[15] <= 0.5) { + if (features[16] <= 2.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } + } + } + } else { + if (features[1] <= 182.5) { + if (features[1] <= 172.0) { + if (features[2] <= 37.5) { + classes[0] = 0; + classes[1] = 103; + } else { + if (features[1] <= 64.5) { + if (features[14] <= 2.5) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 35; + } + } + } else { + if (features[0] <= 44.5) { + classes[0] = 0; + classes[1] = 11; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[14] <= 1.5) { + if (features[2] <= 46.0) { + if (features[9] <= 68.5) { + classes[0] = 0; + classes[1] = 11; + } else { + if (features[2] <= 36.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[0] <= 1.5) { + if (features[7] <= 255.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 13; + classes[1] = 0; + } + } else { + if (features[12] <= 62.5) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 16; + } + } + } + } + } else { + if (features[7] <= 125.0) { + if (features[18] <= 0.5) { + if (features[12] <= 4.5) { + if (features[4] <= 456.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + if (features[16] <= 1.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[9] <= 37.0) { + classes[0] = 0; + classes[1] = 40; + } else { + if (features[2] <= 10.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[4] <= 701.0) { + classes[0] = 0; + classes[1] = 8; + } else { + if (features[8] <= 11.5) { + if (features[5] <= 2.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 25; + } + } else { + if (features[0] <= 32.5) { + if (features[8] <= 6.5) { + if (features[7] <= 138.0) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[14] <= 0.5) { + if (features[15] <= 4.0) { + if (features[9] <= 91.0) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 19; + } + } + } else { + if (features[7] <= 319.0) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[2] <= 54.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[9] <= 689.5) { + if (features[9] <= 76.0) { + if (features[4] <= 637.5) { + if (features[17] <= 0.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[4] <= 1608.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_19(float features[]) { + int classes[2]; + + if (features[4] <= 17.5) { + if (features[17] <= 0.5) { + if (features[9] <= 12.5) { + if (features[13] <= 3.5) { + if (features[16] <= 1.5) { + classes[0] = 738; + classes[1] = 0; + } else { + if (features[9] <= 6.5) { + if (features[7] <= 115.5) { + if (features[12] <= 8.0) { + classes[0] = 61; + classes[1] = 0; + } else { + if (features[12] <= 10.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 23; + classes[1] = 0; + } + } + } else { + if (features[7] <= 124.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[2] <= 40.5) { + if (features[12] <= 4.0) { + if (features[0] <= 5.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 26; + classes[1] = 0; + } + } else { + if (features[0] <= 6.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[11] <= 0.5) { + if (features[14] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } + } else { + if (features[14] <= 0.5) { + if (features[1] <= 37.0) { + if (features[12] <= 1.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[18] <= 0.5) { + classes[0] = 13; + classes[1] = 0; + } else { + if (features[1] <= 136.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[12] <= 9.0) { + if (features[9] <= 10.5) { + if (features[15] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[9] <= 9.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + if (features[0] <= 11.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } + } else { + if (features[5] <= 0.5) { + classes[0] = 22; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[13] <= 0.5) { + if (features[0] <= 18.5) { + if (features[14] <= 0.5) { + if (features[0] <= 1.5) { + classes[0] = 14; + classes[1] = 0; + } else { + if (features[0] <= 8.5) { + if (features[16] <= 1.5) { + classes[0] = 26; + classes[1] = 0; + } else { + if (features[15] <= 7.0) { + if (features[16] <= 2.5) { + if (features[6] <= 0.5) { + if (features[7] <= 41.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[2] <= 28.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 19; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[16] <= 3.5) { + if (features[11] <= 1.5) { + if (features[1] <= 99.5) { + if (features[9] <= 31.5) { + if (features[15] <= 0.5) { + if (features[1] <= 96.5) { + classes[0] = 10; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 12; + classes[1] = 0; + } + } else { + if (features[0] <= 11.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 24; + classes[1] = 0; + } + } else { + if (features[0] <= 12.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 16; + } + } + } + } else { + if (features[8] <= 1.5) { + if (features[1] <= 164.5) { + if (features[15] <= 4.5) { + if (features[2] <= 30.0) { + if (features[9] <= 21.5) { + if (features[5] <= 0.5) { + if (features[12] <= 19.5) { + if (features[9] <= 19.5) { + if (features[16] <= 3.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[15] <= 0.5) { + if (features[7] <= 40.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[2] <= 10.5) { + if (features[16] <= 2.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } + } else { + if (features[18] <= 0.5) { + if (features[15] <= 3.0) { + classes[0] = 0; + classes[1] = 10; + } else { + if (features[1] <= 149.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[1] <= 53.5) { + if (features[2] <= 36.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[0] <= 10.0) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[0] <= 11.5) { + if (features[7] <= 233.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 14; + } + } else { + if (features[12] <= 5.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[18] <= 0.5) { + if (features[0] <= 12.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[2] <= 52.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[16] <= 1.5) { + classes[0] = 225; + classes[1] = 0; + } else { + if (features[2] <= 25.5) { + if (features[5] <= 0.5) { + if (features[7] <= 221.5) { + if (features[18] <= 0.5) { + if (features[0] <= 27.5) { + if (features[1] <= 154.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[9] <= 52.5) { + if (features[2] <= 38.5) { + classes[0] = 0; + classes[1] = 11; + } else { + if (features[9] <= 27.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[2] <= 53.0) { + if (features[18] <= 0.5) { + if (features[1] <= 104.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } + } else { + if (features[14] <= 26.0) { + if (features[12] <= 5.5) { + if (features[9] <= 16.5) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[0] <= 17.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[12] <= 29.5) { + if (features[16] <= 6.0) { + if (features[12] <= 28.5) { + if (features[16] <= 3.5) { + classes[0] = 45; + classes[1] = 0; + } else { + if (features[7] <= 268.0) { + classes[0] = 12; + classes[1] = 0; + } else { + if (features[0] <= 5.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 53; + classes[1] = 0; + } + } + } else { + if (features[16] <= 3.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[9] <= 59.0) { + if (features[8] <= 0.5) { + if (features[1] <= 18.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[0] <= 0.5) { + if (features[16] <= 3.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[2] <= 50.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[1] <= 61.0) { + if (features[7] <= 75.0) { + if (features[14] <= 2.5) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 19; + } + } else { + classes[0] = 0; + classes[1] = 111; + } + } + } + } else { + classes[0] = 0; + classes[1] = 24; + } + } else { + if (features[18] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + if (features[0] <= 18.5) { + if (features[16] <= 0.5) { + classes[0] = 32; + classes[1] = 0; + } else { + if (features[14] <= 14.0) { + if (features[17] <= 0.5) { + if (features[12] <= 87.5) { + if (features[9] <= 15.5) { + if (features[15] <= 1.5) { + if (features[7] <= 73.0) { + if (features[16] <= 3.0) { + if (features[4] <= 86.0) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 8; + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } else { + if (features[9] <= 10.0) { + if (features[12] <= 7.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + if (features[15] <= 10.0) { + if (features[2] <= 23.5) { + classes[0] = 15; + classes[1] = 0; + } else { + if (features[1] <= 170.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[7] <= 192.0) { + if (features[3] <= 5.5) { + if (features[14] <= 7.0) { + if (features[16] <= 1.5) { + if (features[13] <= 0.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[2] <= 8.5) { + if (features[3] <= 1.5) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 64; + } + } + } else { + if (features[0] <= 14.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[0] <= 4.5) { + if (features[9] <= 64.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } + } else { + if (features[9] <= 44.5) { + if (features[4] <= 91.0) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[15] <= 1.5) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[9] <= 30.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } + } + } else { + if (features[5] <= 0.5) { + classes[0] = 11; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[9] <= 4.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 60; + } + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + if (features[18] <= 0.5) { + if (features[1] <= 117.0) { + if (features[7] <= 279.5) { + if (features[0] <= 30.5) { + classes[0] = 29; + classes[1] = 0; + } else { + if (features[9] <= 32.0) { + if (features[0] <= 32.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[16] <= 3.5) { + if (features[0] <= 28.0) { + if (features[12] <= 47.5) { + if (features[2] <= 19.5) { + if (features[14] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[15] <= 5.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[16] <= 2.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[3] <= 5.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[1] <= 126.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[2] <= 36.5) { + classes[0] = 34; + classes[1] = 0; + } else { + if (features[2] <= 39.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } + } else { + if (features[6] <= 1.0) { + if (features[1] <= 451.5) { + if (features[8] <= 49.5) { + classes[0] = 0; + classes[1] = 21; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } else { + if (features[14] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[3] <= 1.5) { + if (features[2] <= 12.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 8; + } + } else { + classes[0] = 0; + classes[1] = 11; + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_20(float features[]) { + int classes[2]; + + if (features[12] <= 3.5) { + if (features[7] <= 57.5) { + if (features[18] <= 0.5) { + if (features[14] <= 0.5) { + classes[0] = 290; + classes[1] = 0; + } else { + if (features[3] <= 0.5) { + classes[0] = 12; + classes[1] = 0; + } else { + if (features[15] <= 1.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[17] <= 0.5) { + if (features[9] <= 14.5) { + if (features[2] <= 14.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[16] <= 1.5) { + if (features[4] <= 35.5) { + classes[0] = 94; + classes[1] = 0; + } else { + if (features[7] <= 78.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[9] <= 14.5) { + if (features[16] <= 3.5) { + if (features[12] <= 0.5) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[7] <= 89.5) { + if (features[0] <= 5.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[0] <= 10.5) { + classes[0] = 0; + classes[1] = 12; + } else { + if (features[0] <= 11.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[9] <= 79.0) { + if (features[4] <= 437.0) { + classes[0] = 0; + classes[1] = 13; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } + } + } else { + if (features[14] <= 0.5) { + if (features[4] <= 153.0) { + if (features[16] <= 1.5) { + if (features[17] <= 0.5) { + if (features[0] <= 15.5) { + if (features[16] <= 0.5) { + classes[0] = 190; + classes[1] = 0; + } else { + if (features[8] <= 2.5) { + if (features[12] <= 19.0) { + if (features[0] <= 14.5) { + if (features[9] <= 47.0) { + if (features[12] <= 10.0) { + if (features[13] <= 0.5) { + if (features[9] <= 0.5) { + if (features[2] <= 9.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 16; + classes[1] = 0; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + if (features[2] <= 7.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[15] <= 1.0) { + if (features[9] <= 1.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 15; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 372; + classes[1] = 0; + } + } else { + if (features[7] <= 286.5) { + classes[0] = 0; + classes[1] = 11; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[7] <= 59.5) { + if (features[7] <= 39.0) { + if (features[0] <= 2.5) { + classes[0] = 0; + classes[1] = 13; + } else { + if (features[16] <= 2.5) { + classes[0] = 14; + classes[1] = 0; + } else { + if (features[7] <= 34.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[3] <= 0.5) { + classes[0] = 27; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[17] <= 0.5) { + if (features[2] <= 21.5) { + if (features[7] <= 73.0) { + if (features[15] <= 2.0) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[9] <= 13.5) { + classes[0] = 32; + classes[1] = 0; + } else { + if (features[16] <= 3.5) { + if (features[0] <= 14.5) { + if (features[7] <= 119.5) { + if (features[0] <= 12.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 14; + classes[1] = 0; + } + } else { + if (features[15] <= 1.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[4] <= 38.5) { + if (features[0] <= 4.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[2] <= 11.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } + } else { + if (features[7] <= 180.5) { + if (features[2] <= 60.0) { + if (features[9] <= 5.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[0] <= 30.0) { + if (features[7] <= 62.5) { + if (features[12] <= 7.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[11] <= 0.5) { + if (features[7] <= 129.5) { + classes[0] = 0; + classes[1] = 19; + } else { + if (features[0] <= 16.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[0] <= 62.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[1] <= 112.0) { + if (features[7] <= 235.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[0] <= 21.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[7] <= 414.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[7] <= 299.0) { + classes[0] = 17; + classes[1] = 0; + } else { + if (features[1] <= 336.0) { + if (features[2] <= 40.5) { + if (features[12] <= 20.5) { + if (features[12] <= 8.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + if (features[2] <= 61.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[1] <= 225.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[11] <= 0.5) { + if (features[12] <= 18.0) { + if (features[9] <= 68.5) { + classes[0] = 0; + classes[1] = 13; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 23; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } else { + if (features[16] <= 2.5) { + if (features[13] <= 0.5) { + if (features[16] <= 0.5) { + classes[0] = 11; + classes[1] = 0; + } else { + if (features[7] <= 144.5) { + if (features[3] <= 5.5) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[1] <= 81.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[11] <= 1.0) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + classes[0] = 14; + classes[1] = 0; + } + } else { + if (features[9] <= 4.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[7] <= 392.5) { + if (features[7] <= 227.0) { + classes[0] = 0; + classes[1] = 42; + } else { + if (features[8] <= 26.5) { + classes[0] = 0; + classes[1] = 10; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[1] <= 174.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[3] <= 1.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } + } + } + } else { + if (features[9] <= 7.5) { + if (features[8] <= 1.5) { + classes[0] = 106; + classes[1] = 0; + } else { + if (features[9] <= 3.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[16] <= 1.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 138; + classes[1] = 0; + } else { + if (features[12] <= 49.5) { + if (features[2] <= 66.5) { + if (features[17] <= 0.5) { + if (features[2] <= 13.5) { + if (features[15] <= 1.5) { + if (features[16] <= 1.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 16; + } + } else { + if (features[8] <= 0.5) { + if (features[9] <= 24.0) { + classes[0] = 22; + classes[1] = 0; + } else { + if (features[2] <= 6.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[7] <= 160.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[16] <= 2.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[6] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[2] <= 54.5) { + if (features[0] <= 3.5) { + if (features[16] <= 2.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[1] <= 100.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } else { + if (features[12] <= 8.5) { + if (features[6] <= 0.5) { + if (features[14] <= 8.0) { + if (features[11] <= 1.5) { + if (features[8] <= 0.5) { + if (features[12] <= 4.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[18] <= 0.5) { + if (features[13] <= 0.5) { + if (features[1] <= 142.0) { + if (features[9] <= 18.5) { + classes[0] = 0; + classes[1] = 14; + } else { + if (features[9] <= 21.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[7] <= 193.0) { + if (features[9] <= 15.5) { + if (features[12] <= 26.5) { + if (features[16] <= 2.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[7] <= 102.5) { + if (features[18] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[14] <= 2.0) { + if (features[9] <= 43.5) { + classes[0] = 0; + classes[1] = 68; + } else { + if (features[2] <= 21.0) { + if (features[2] <= 15.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + classes[0] = 0; + classes[1] = 25; + } + } + } else { + if (features[8] <= 6.5) { + if (features[0] <= 16.5) { + if (features[8] <= 2.5) { + if (features[9] <= 34.0) { + if (features[12] <= 13.5) { + if (features[16] <= 3.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[7] <= 213.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[8] <= 0.5) { + classes[0] = 0; + classes[1] = 13; + } else { + if (features[4] <= 49.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[9] <= 11.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[1] <= 451.5) { + if (features[8] <= 26.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + if (features[4] <= 12.5) { + if (features[2] <= 47.0) { + if (features[5] <= 0.5) { + if (features[8] <= 0.5) { + if (features[18] <= 0.5) { + if (features[15] <= 9.0) { + classes[0] = 0; + classes[1] = 11; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 48; + } + } else { + if (features[12] <= 33.5) { + classes[0] = 0; + classes[1] = 10; + } else { + if (features[15] <= 9.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 0; + classes[1] = 21; + } + } else { + if (features[1] <= 151.5) { + classes[0] = 0; + classes[1] = 11; + } else { + if (features[0] <= 4.5) { + if (features[1] <= 190.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[9] <= 17.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } + } + } else { + classes[0] = 0; + classes[1] = 63; + } + } + } else { + if (features[14] <= 2.0) { + if (features[0] <= 9.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[7] <= 165.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + if (features[17] <= 0.5) { + if (features[0] <= 6.5) { + if (features[2] <= 43.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[2] <= 39.5) { + if (features[1] <= 309.0) { + classes[0] = 18; + classes[1] = 0; + } else { + if (features[3] <= 8.5) { + classes[0] = 12; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[12] <= 72.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_21(float features[]) { + int classes[2]; + + if (features[16] <= 1.5) { + if (features[17] <= 0.5) { + if (features[7] <= 93.5) { + if (features[7] <= 92.5) { + if (features[0] <= 16.5) { + if (features[16] <= 0.5) { + classes[0] = 284; + classes[1] = 0; + } else { + if (features[2] <= 11.5) { + if (features[12] <= 8.5) { + if (features[8] <= 0.5) { + if (features[1] <= 34.5) { + classes[0] = 23; + classes[1] = 0; + } else { + if (features[2] <= 9.5) { + if (features[15] <= 1.5) { + if (features[0] <= 1.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[2] <= 7.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[13] <= 1.5) { + classes[0] = 78; + classes[1] = 0; + } else { + if (features[12] <= 8.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + classes[0] = 112; + classes[1] = 0; + } + } else { + if (features[12] <= 9.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 640; + classes[1] = 0; + } else { + if (features[2] <= 12.5) { + if (features[7] <= 177.5) { + classes[0] = 11; + classes[1] = 0; + } else { + if (features[8] <= 17.0) { + if (features[2] <= 11.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[7] <= 405.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 52; + classes[1] = 0; + } + } + } + } else { + if (features[12] <= 17.5) { + if (features[9] <= 5.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[14] <= 7.5) { + classes[0] = 0; + classes[1] = 38; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + if (features[9] <= 7.5) { + if (features[3] <= 2.5) { + if (features[9] <= 0.5) { + classes[0] = 44; + classes[1] = 0; + } else { + if (features[18] <= 0.5) { + if (features[5] <= 0.5) { + if (features[7] <= 183.5) { + if (features[15] <= 0.5) { + if (features[11] <= 2.0) { + if (features[9] <= 1.5) { + if (features[2] <= 13.0) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[1] <= 27.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 13; + } + } + } else { + if (features[0] <= 6.0) { + if (features[16] <= 4.0) { + if (features[7] <= 25.0) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[1] <= 83.0) { + if (features[9] <= 4.0) { + if (features[9] <= 2.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[0] <= 1.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[0] <= 18.0) { + classes[0] = 17; + classes[1] = 0; + } else { + if (features[7] <= 155.0) { + classes[0] = 8; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[9] <= 6.5) { + classes[0] = 28; + classes[1] = 0; + } else { + if (features[0] <= 18.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + classes[0] = 25; + classes[1] = 0; + } + } else { + if (features[7] <= 116.0) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } else { + if (features[17] <= 0.5) { + if (features[1] <= 63.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } else { + if (features[1] <= 53.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } else { + if (features[17] <= 0.5) { + if (features[7] <= 124.5) { + if (features[9] <= 17.5) { + if (features[13] <= 0.5) { + if (features[2] <= 23.5) { + if (features[2] <= 5.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[12] <= 1.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[2] <= 6.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[12] <= 31.5) { + if (features[3] <= 1.5) { + if (features[14] <= 2.5) { + if (features[9] <= 10.5) { + if (features[5] <= 1.0) { + if (features[4] <= 27.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[7] <= 25.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 18; + classes[1] = 0; + } + } + } else { + if (features[0] <= 8.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[14] <= 8.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[12] <= 6.5) { + if (features[1] <= 41.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[6] <= 2.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[12] <= 39.5) { + if (features[7] <= 81.5) { + if (features[7] <= 61.5) { + classes[0] = 0; + classes[1] = 8; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[14] <= 0.5) { + classes[0] = 11; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[1] <= 327.5) { + if (features[15] <= 4.5) { + if (features[7] <= 24.5) { + if (features[7] <= 22.5) { + if (features[4] <= 36.0) { + if (features[9] <= 18.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[4] <= 583.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[16] <= 2.5) { + if (features[9] <= 19.5) { + if (features[0] <= 14.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + if (features[11] <= 3.5) { + if (features[12] <= 4.5) { + if (features[15] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[2] <= 15.5) { + if (features[1] <= 120.5) { + if (features[12] <= 10.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 31; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[9] <= 114.5) { + if (features[11] <= 4.0) { + if (features[13] <= 0.5) { + if (features[0] <= 12.5) { + classes[0] = 0; + classes[1] = 62; + } else { + if (features[1] <= 178.5) { + classes[0] = 0; + classes[1] = 28; + } else { + if (features[9] <= 40.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 14; + } + } else { + if (features[4] <= 232.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[7] <= 55.0) { + if (features[14] <= 14.5) { + if (features[9] <= 57.0) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[15] <= 6.0) { + if (features[1] <= 66.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + if (features[12] <= 40.0) { + if (features[12] <= 36.5) { + if (features[9] <= 18.5) { + if (features[0] <= 34.5) { + if (features[15] <= 3.5) { + if (features[18] <= 0.5) { + if (features[12] <= 20.5) { + if (features[1] <= 87.0) { + if (features[9] <= 10.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 18; + classes[1] = 0; + } + } else { + if (features[2] <= 34.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[12] <= 25.5) { + if (features[8] <= 1.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[2] <= 25.0) { + if (features[3] <= 1.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[7] <= 442.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + if (features[14] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } else { + if (features[15] <= 2.5) { + if (features[12] <= 31.5) { + if (features[9] <= 34.5) { + if (features[2] <= 73.5) { + if (features[13] <= 1.5) { + if (features[12] <= 8.5) { + if (features[14] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[2] <= 38.0) { + if (features[2] <= 29.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[9] <= 80.0) { + if (features[12] <= 3.0) { + if (features[3] <= 3.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[3] <= 3.5) { + classes[0] = 0; + classes[1] = 9; + } else { + if (features[9] <= 48.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[2] <= 36.5) { + if (features[1] <= 135.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[6] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[12] <= 16.5) { + classes[0] = 0; + classes[1] = 17; + } else { + if (features[9] <= 19.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[2] <= 20.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } + } + } + } else { + if (features[9] <= 26.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 9; + } + } + } else { + if (features[15] <= 11.0) { + if (features[3] <= 0.5) { + if (features[13] <= 0.5) { + if (features[2] <= 28.0) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[1] <= 279.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } else { + classes[0] = 28; + classes[1] = 0; + } + } else { + if (features[0] <= 8.5) { + if (features[4] <= 106.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[3] <= 2.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } + } + } else { + if (features[8] <= 46.0) { + if (features[12] <= 62.5) { + if (features[11] <= 0.5) { + if (features[8] <= 0.5) { + if (features[3] <= 0.5) { + if (features[9] <= 21.5) { + classes[0] = 0; + classes[1] = 68; + } else { + if (features[7] <= 258.5) { + if (features[7] <= 80.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 52; + } + } else { + if (features[16] <= 4.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 0; + classes[1] = 49; + } + } else { + if (features[0] <= 30.5) { + classes[0] = 0; + classes[1] = 27; + } else { + if (features[12] <= 33.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[11] <= 1.5) { + if (features[9] <= 44.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_22(float features[]) { + int classes[2]; + + if (features[14] <= 0.5) { + if (features[17] <= 0.5) { + if (features[16] <= 2.5) { + if (features[4] <= 21.0) { + if (features[5] <= 0.5) { + if (features[0] <= 22.5) { + if (features[16] <= 1.5) { + if (features[6] <= 0.5) { + if (features[7] <= 5.5) { + if (features[1] <= 35.5) { + classes[0] = 97; + classes[1] = 0; + } else { + if (features[15] <= 1.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[0] <= 9.5) { + classes[0] = 266; + classes[1] = 0; + } else { + if (features[9] <= 51.0) { + if (features[12] <= 11.5) { + if (features[12] <= 10.5) { + classes[0] = 64; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 81; + classes[1] = 0; + } + } else { + if (features[9] <= 53.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 13; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + if (features[11] <= 0.5) { + if (features[7] <= 33.0) { + classes[0] = 23; + classes[1] = 0; + } else { + if (features[15] <= 0.5) { + if (features[9] <= 24.5) { + if (features[1] <= 82.5) { + if (features[6] <= 0.5) { + if (features[2] <= 13.0) { + if (features[7] <= 55.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[12] <= 13.0) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[1] <= 97.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[7] <= 81.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + if (features[9] <= 182.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[7] <= 120.5) { + if (features[9] <= 9.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[0] <= 10.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[18] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 15; + classes[1] = 0; + } + } + } else { + classes[0] = 358; + classes[1] = 0; + } + } else { + if (features[2] <= 61.0) { + classes[0] = 33; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[7] <= 93.5) { + if (features[7] <= 49.5) { + if (features[9] <= 9.5) { + if (features[11] <= 0.5) { + if (features[9] <= 3.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 15; + classes[1] = 0; + } + } else { + if (features[1] <= 128.5) { + if (features[9] <= 15.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 13; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[5] <= 0.5) { + if (features[7] <= 215.0) { + if (features[7] <= 203.0) { + if (features[3] <= 10.5) { + if (features[1] <= 191.5) { + classes[0] = 22; + classes[1] = 0; + } else { + if (features[16] <= 1.5) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[4] <= 548.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 34; + classes[1] = 0; + } + } else { + if (features[0] <= 27.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } else { + if (features[0] <= 16.5) { + if (features[4] <= 78.0) { + if (features[2] <= 19.5) { + if (features[11] <= 8.0) { + if (features[18] <= 0.5) { + if (features[1] <= 13.0) { + classes[0] = 16; + classes[1] = 0; + } else { + if (features[7] <= 33.5) { + if (features[16] <= 5.0) { + if (features[16] <= 3.5) { + if (features[12] <= 4.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[12] <= 6.0) { + if (features[15] <= 1.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[9] <= 13.5) { + classes[0] = 26; + classes[1] = 0; + } else { + if (features[0] <= 11.5) { + if (features[8] <= 0.5) { + if (features[13] <= 0.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[7] <= 280.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } + } else { + if (features[2] <= 4.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[7] <= 238.0) { + if (features[1] <= 49.5) { + if (features[7] <= 85.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[16] <= 4.5) { + classes[0] = 0; + classes[1] = 14; + } else { + if (features[13] <= 1.0) { + classes[0] = 0; + classes[1] = 10; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + if (features[9] <= 4.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[7] <= 333.5) { + classes[0] = 0; + classes[1] = 31; + } else { + if (features[4] <= 213.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[3] <= 9.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } + } else { + if (features[7] <= 201.5) { + if (features[2] <= 38.5) { + if (features[12] <= 8.5) { + if (features[12] <= 7.5) { + classes[0] = 14; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 23; + classes[1] = 0; + } + } else { + if (features[2] <= 45.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[3] <= 5.5) { + if (features[13] <= 3.0) { + if (features[9] <= 19.0) { + if (features[4] <= 184.0) { + classes[0] = 10; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[8] <= 13.0) { + if (features[2] <= 30.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[2] <= 43.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[15] <= 17.0) { + if (features[12] <= 28.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } + } else { + if (features[0] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[16] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[1] <= 257.0) { + if (features[11] <= 0.5) { + classes[0] = 0; + classes[1] = 57; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[16] <= 3.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } + } else { + if (features[17] <= 0.5) { + if (features[9] <= 21.5) { + if (features[16] <= 1.5) { + if (features[14] <= 1.5) { + if (features[18] <= 0.5) { + if (features[15] <= 0.5) { + if (features[13] <= 1.0) { + classes[0] = 23; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 18; + classes[1] = 0; + } + } else { + if (features[2] <= 33.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 134; + classes[1] = 0; + } + } else { + if (features[18] <= 0.5) { + if (features[12] <= 7.5) { + if (features[9] <= 6.5) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[9] <= 19.0) { + if (features[7] <= 54.0) { + if (features[1] <= 33.0) { + if (features[2] <= 18.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 13; + } + } else { + if (features[9] <= 13.0) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[2] <= 66.5) { + if (features[2] <= 8.5) { + if (features[1] <= 134.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + if (features[8] <= 0.5) { + if (features[7] <= 42.5) { + classes[0] = 0; + classes[1] = 7; + } else { + if (features[1] <= 159.5) { + if (features[2] <= 27.5) { + classes[0] = 17; + classes[1] = 0; + } else { + if (features[2] <= 34.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + if (features[1] <= 251.5) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[7] <= 206.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[1] <= 302.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[7] <= 96.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 27; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[1] <= 35.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 14; + } + } + } + } else { + if (features[16] <= 2.5) { + if (features[14] <= 6.5) { + if (features[0] <= 7.5) { + if (features[1] <= 150.0) { + if (features[12] <= 15.5) { + if (features[8] <= 2.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 16; + classes[1] = 0; + } + } else { + if (features[16] <= 0.5) { + classes[0] = 15; + classes[1] = 0; + } else { + if (features[8] <= 2.5) { + if (features[15] <= 1.5) { + if (features[7] <= 123.0) { + classes[0] = 0; + classes[1] = 11; + } else { + if (features[3] <= 4.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } + } + } else { + classes[0] = 57; + classes[1] = 0; + } + } else { + if (features[8] <= 2.5) { + if (features[15] <= 4.5) { + if (features[2] <= 53.0) { + if (features[6] <= 12.5) { + classes[0] = 0; + classes[1] = 94; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[16] <= 4.5) { + if (features[1] <= 342.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + if (features[1] <= 341.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[1] <= 421.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[15] <= 36.5) { + if (features[0] <= 0.5) { + if (features[1] <= 114.0) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[16] <= 3.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[12] <= 28.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[18] <= 0.5) { + if (features[0] <= 43.5) { + if (features[15] <= 0.5) { + if (features[9] <= 15.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + if (features[7] <= 73.5) { + if (features[8] <= 0.5) { + if (features[3] <= 0.5) { + if (features[12] <= 7.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + classes[0] = 0; + classes[1] = 32; + } + } + } else { + if (features[1] <= 200.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[7] <= 46.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[1] <= 82.0) { + if (features[1] <= 78.5) { + classes[0] = 0; + classes[1] = 38; + } else { + if (features[12] <= 7.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 118; + } + } + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_23(float features[]) { + int classes[2]; + + if (features[18] <= 0.5) { + if (features[12] <= 4.5) { + if (features[1] <= 21.5) { + classes[0] = 239; + classes[1] = 0; + } else { + if (features[16] <= 4.5) { + if (features[15] <= 4.5) { + if (features[17] <= 0.5) { + if (features[0] <= 6.5) { + if (features[4] <= 35.5) { + if (features[12] <= 1.5) { + classes[0] = 26; + classes[1] = 0; + } else { + if (features[16] <= 2.5) { + classes[0] = 21; + classes[1] = 0; + } else { + if (features[11] <= 0.5) { + if (features[15] <= 1.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[12] <= 3.5) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 3.5) { + classes[0] = 159; + classes[1] = 0; + } else { + if (features[0] <= 11.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + if (features[1] <= 40.5) { + classes[0] = 25; + classes[1] = 0; + } else { + if (features[0] <= 10.0) { + classes[0] = 0; + classes[1] = 9; + } else { + if (features[0] <= 14.0) { + if (features[14] <= 5.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } + } + } else { + if (features[3] <= 0.5) { + if (features[9] <= 21.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } + } else { + if (features[9] <= 11.5) { + if (features[2] <= 30.5) { + if (features[7] <= 50.5) { + if (features[1] <= 437.5) { + if (features[15] <= 0.5) { + if (features[11] <= 0.5) { + if (features[7] <= 33.0) { + classes[0] = 18; + classes[1] = 0; + } else { + if (features[0] <= 5.0) { + if (features[7] <= 36.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 16; + classes[1] = 0; + } + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + if (features[12] <= 5.5) { + if (features[0] <= 8.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 14; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[16] <= 1.5) { + classes[0] = 167; + classes[1] = 0; + } else { + if (features[3] <= 2.5) { + if (features[15] <= 3.5) { + if (features[0] <= 5.5) { + if (features[2] <= 9.5) { + if (features[6] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } else { + classes[0] = 36; + classes[1] = 0; + } + } else { + if (features[8] <= 0.5) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[14] <= 1.0) { + if (features[0] <= 6.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[9] <= 4.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + if (features[5] <= 0.5) { + if (features[9] <= 6.5) { + if (features[12] <= 6.5) { + if (features[14] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[1] <= 195.0) { + classes[0] = 33; + classes[1] = 0; + } else { + if (features[12] <= 31.0) { + if (features[15] <= 1.0) { + if (features[9] <= 2.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 17; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 1.5) { + classes[0] = 14; + classes[1] = 0; + } else { + if (features[13] <= 0.5) { + if (features[11] <= 18.0) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[1] <= 119.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } else { + if (features[4] <= 46.5) { + if (features[12] <= 9.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[14] <= 2.0) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[3] <= 0.5) { + if (features[8] <= 0.5) { + if (features[0] <= 10.5) { + if (features[7] <= 118.0) { + if (features[15] <= 8.5) { + if (features[7] <= 26.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[16] <= 1.5) { + classes[0] = 13; + classes[1] = 0; + } else { + if (features[14] <= 6.0) { + if (features[14] <= 0.5) { + if (features[9] <= 13.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[7] <= 91.5) { + classes[0] = 0; + classes[1] = 21; + } else { + if (features[13] <= 3.0) { + if (features[7] <= 94.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 30; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[11] <= 0.5) { + if (features[5] <= 0.5) { + if (features[12] <= 11.5) { + if (features[17] <= 0.5) { + if (features[12] <= 8.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[9] <= 15.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 16; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 222; + classes[1] = 0; + } else { + if (features[17] <= 0.5) { + if (features[13] <= 0.5) { + if (features[9] <= 12.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[14] <= 0.5) { + if (features[12] <= 17.5) { + if (features[16] <= 4.0) { + if (features[12] <= 7.5) { + if (features[9] <= 36.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[0] <= 32.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + if (features[7] <= 141.0) { + if (features[7] <= 115.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } else { + if (features[14] <= 1.5) { + if (features[9] <= 15.5) { + if (features[1] <= 86.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[12] <= 8.0) { + if (features[0] <= 46.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + if (features[2] <= 49.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + if (features[7] <= 89.0) { + if (features[1] <= 100.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 27; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } else { + if (features[16] <= 1.5) { + if (features[0] <= 17.0) { + if (features[12] <= 9.0) { + if (features[8] <= 1.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 14; + classes[1] = 0; + } + } else { + classes[0] = 38; + classes[1] = 0; + } + } else { + if (features[16] <= 4.5) { + if (features[13] <= 2.5) { + if (features[9] <= 14.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[15] <= 1.5) { + if (features[16] <= 3.5) { + if (features[12] <= 18.0) { + if (features[0] <= 13.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[1] <= 360.5) { + if (features[2] <= 21.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[8] <= 2.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + if (features[12] <= 59.0) { + classes[0] = 0; + classes[1] = 19; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } + } + } else { + if (features[12] <= 53.5) { + if (features[3] <= 2.5) { + if (features[16] <= 0.5) { + classes[0] = 35; + classes[1] = 0; + } else { + if (features[6] <= 1.5) { + if (features[9] <= 18.5) { + if (features[3] <= 1.5) { + if (features[4] <= 71.5) { + if (features[1] <= 103.0) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[6] <= 0.5) { + if (features[4] <= 85.0) { + classes[0] = 0; + classes[1] = 10; + } else { + if (features[8] <= 0.5) { + if (features[14] <= 0.5) { + if (features[9] <= 17.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[14] <= 0.5) { + if (features[1] <= 65.0) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[7] <= 442.5) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + if (features[16] <= 3.5) { + if (features[0] <= 22.0) { + classes[0] = 0; + classes[1] = 38; + } else { + if (features[3] <= 1.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[9] <= 34.5) { + if (features[2] <= 20.5) { + if (features[2] <= 16.5) { + if (features[1] <= 101.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[9] <= 40.5) { + if (features[9] <= 38.5) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } else { + if (features[0] <= 36.5) { + if (features[7] <= 227.0) { + if (features[2] <= 8.5) { + if (features[1] <= 66.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[7] <= 40.0) { + if (features[7] <= 30.0) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[16] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 48; + } + } + } + } else { + if (features[3] <= 6.5) { + if (features[13] <= 0.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + if (features[2] <= 19.5) { + if (features[16] <= 3.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } + } else { + if (features[4] <= 1079.0) { + classes[0] = 23; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } + } else { + if (features[17] <= 0.5) { + if (features[7] <= 111.0) { + if (features[16] <= 0.5) { + classes[0] = 21; + classes[1] = 0; + } else { + if (features[14] <= 0.5) { + if (features[16] <= 4.5) { + if (features[9] <= 35.0) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 20; + } + } + } else { + if (features[5] <= 1.5) { + if (features[7] <= 243.5) { + if (features[15] <= 0.5) { + if (features[14] <= 0.5) { + classes[0] = 17; + classes[1] = 0; + } else { + if (features[9] <= 15.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 9; + } + } + } else { + if (features[9] <= 31.5) { + if (features[15] <= 14.0) { + if (features[16] <= 4.5) { + classes[0] = 31; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[16] <= 3.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[9] <= 22.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[12] <= 23.5) { + if (features[9] <= 48.0) { + if (features[16] <= 1.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + if (features[16] <= 1.5) { + classes[0] = 118; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[7] <= 580.0) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[1] <= 430.5) { + if (features[0] <= 0.5) { + if (features[7] <= 255.0) { + if (features[14] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[12] <= 18.5) { + classes[0] = 0; + classes[1] = 101; + } else { + if (features[9] <= 6.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 79; + } + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_24(float features[]) { + int classes[2]; + + if (features[16] <= 1.5) { + if (features[14] <= 0.5) { + if (features[17] <= 0.5) { + if (features[3] <= 0.5) { + if (features[15] <= 0.5) { + if (features[9] <= 36.5) { + if (features[0] <= 3.5) { + if (features[12] <= 3.5) { + classes[0] = 197; + classes[1] = 0; + } else { + if (features[9] <= 0.5) { + if (features[16] <= 0.5) { + classes[0] = 16; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 32; + classes[1] = 0; + } + } + } else { + classes[0] = 315; + classes[1] = 0; + } + } else { + if (features[18] <= 0.5) { + if (features[8] <= 0.5) { + if (features[2] <= 11.5) { + classes[0] = 23; + classes[1] = 0; + } else { + if (features[11] <= 1.5) { + if (features[2] <= 12.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 16; + classes[1] = 0; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + if (features[2] <= 14.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } else { + classes[0] = 13; + classes[1] = 0; + } + } + } else { + classes[0] = 245; + classes[1] = 0; + } + } else { + if (features[12] <= 3.5) { + if (features[0] <= 0.5) { + if (features[2] <= 11.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[1] <= 67.0) { + if (features[8] <= 0.5) { + if (features[12] <= 6.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[8] <= 3.5) { + classes[0] = 54; + classes[1] = 0; + } else { + if (features[1] <= 145.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[15] <= 3.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 14; + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 214; + classes[1] = 0; + } else { + if (features[14] <= 2.5) { + if (features[6] <= 0.5) { + if (features[12] <= 5.0) { + if (features[7] <= 67.5) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[18] <= 0.5) { + if (features[15] <= 5.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 14; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + if (features[13] <= 0.5) { + classes[0] = 21; + classes[1] = 0; + } else { + if (features[1] <= 139.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } + } else { + if (features[7] <= 21.5) { + if (features[3] <= 0.5) { + if (features[16] <= 4.5) { + classes[0] = 45; + classes[1] = 0; + } else { + if (features[18] <= 0.5) { + if (features[7] <= 7.0) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[16] <= 5.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[11] <= 6.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[18] <= 0.5) { + if (features[7] <= 124.5) { + if (features[13] <= 0.5) { + if (features[16] <= 4.5) { + if (features[3] <= 0.5) { + if (features[7] <= 85.5) { + if (features[11] <= 0.5) { + if (features[8] <= 0.5) { + if (features[0] <= 12.5) { + if (features[9] <= 8.0) { + if (features[14] <= 0.5) { + if (features[7] <= 32.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[16] <= 2.5) { + if (features[6] <= 0.5) { + if (features[7] <= 35.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + if (features[0] <= 5.5) { + if (features[2] <= 29.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[15] <= 7.0) { + if (features[14] <= 6.0) { + if (features[1] <= 77.0) { + classes[0] = 0; + classes[1] = 16; + } else { + if (features[14] <= 0.5) { + if (features[1] <= 122.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + if (features[7] <= 51.5) { + classes[0] = 11; + classes[1] = 0; + } else { + if (features[9] <= 7.0) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + if (features[0] <= 8.5) { + if (features[8] <= 1.5) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[1] <= 108.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + classes[0] = 16; + classes[1] = 0; + } + } else { + if (features[9] <= 13.5) { + if (features[12] <= 3.5) { + if (features[12] <= 1.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[14] <= 0.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } else { + if (features[6] <= 0.5) { + if (features[16] <= 2.5) { + if (features[2] <= 24.0) { + if (features[2] <= 15.5) { + if (features[7] <= 108.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[7] <= 111.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[8] <= 1.0) { + if (features[2] <= 12.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 12; + } + } else { + classes[0] = 0; + classes[1] = 16; + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } + } + } else { + if (features[0] <= 3.5) { + if (features[14] <= 0.5) { + if (features[15] <= 1.0) { + if (features[1] <= 62.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } else { + if (features[4] <= 147.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 10; + classes[1] = 0; + } + } + } else { + if (features[9] <= 4.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[12] <= 4.0) { + if (features[15] <= 4.5) { + if (features[1] <= 48.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[5] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[12] <= 56.5) { + if (features[4] <= 235.0) { + if (features[9] <= 37.0) { + if (features[0] <= 5.5) { + if (features[15] <= 3.0) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 35; + } + } else { + if (features[4] <= 143.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 36; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 36; + } + } else { + if (features[9] <= 23.5) { + classes[0] = 35; + classes[1] = 0; + } else { + if (features[9] <= 43.0) { + if (features[9] <= 28.5) { + if (features[1] <= 76.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 2.5) { + if (features[3] <= 10.0) { + if (features[7] <= 316.5) { + if (features[0] <= 6.0) { + if (features[14] <= 0.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[12] <= 5.5) { + if (features[14] <= 1.0) { + if (features[1] <= 88.0) { + if (features[0] <= 7.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[4] <= 411.0) { + if (features[0] <= 92.0) { + if (features[0] <= 11.5) { + if (features[4] <= 51.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 23; + classes[1] = 0; + } + } else { + classes[0] = 37; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[15] <= 11.0) { + classes[0] = 10; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + if (features[9] <= 136.5) { + if (features[2] <= 32.0) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[1] <= 358.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[2] <= 30.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[12] <= 30.5) { + if (features[2] <= 31.5) { + if (features[4] <= 32.0) { + if (features[9] <= 24.5) { + if (features[15] <= 2.5) { + if (features[6] <= 6.0) { + if (features[12] <= 3.0) { + if (features[1] <= 100.0) { + if (features[1] <= 65.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 18; + classes[1] = 0; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[9] <= 13.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[1] <= 241.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[13] <= 1.5) { + classes[0] = 0; + classes[1] = 8; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[7] <= 202.0) { + if (features[1] <= 110.0) { + if (features[2] <= 19.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } else { + if (features[4] <= 419.5) { + if (features[4] <= 91.0) { + if (features[1] <= 99.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + if (features[7] <= 343.0) { + classes[0] = 12; + classes[1] = 0; + } else { + if (features[4] <= 182.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } + } else { + if (features[11] <= 1.5) { + if (features[1] <= 275.0) { + if (features[9] <= 7.5) { + if (features[11] <= 0.5) { + classes[0] = 8; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[13] <= 4.0) { + if (features[0] <= 44.5) { + if (features[7] <= 277.5) { + classes[0] = 0; + classes[1] = 24; + } else { + if (features[3] <= 1.5) { + if (features[16] <= 5.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[15] <= 3.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 13; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + if (features[17] <= 0.5) { + if (features[15] <= 4.5) { + if (features[3] <= 1.5) { + classes[0] = 22; + classes[1] = 0; + } else { + if (features[4] <= 207.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[0] <= 26.5) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[3] <= 10.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[3] <= 1.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } + } else { + if (features[9] <= 5.5) { + if (features[7] <= 94.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[15] <= 3.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[7] <= 270.5) { + if (features[17] <= 0.5) { + if (features[5] <= 0.5) { + if (features[1] <= 91.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[7] <= 216.5) { + if (features[15] <= 2.0) { + classes[0] = 0; + classes[1] = 16; + } else { + if (features[15] <= 3.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } else { + if (features[2] <= 44.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[0] <= 28.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 11; + } + } else { + classes[0] = 0; + classes[1] = 154; + } + } else { + if (features[0] <= 11.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[0] <= 73.5) { + classes[0] = 0; + classes[1] = 18; + } else { + if (features[8] <= 14.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_25(float features[]) { + int classes[2]; + + if (features[16] <= 1.5) { + if (features[3] <= 1.5) { + if (features[15] <= 1.5) { + if (features[11] <= 0.5) { + if (features[2] <= 9.5) { + classes[0] = 244; + classes[1] = 0; + } else { + if (features[2] <= 12.5) { + if (features[0] <= 18.0) { + if (features[1] <= 89.5) { + if (features[7] <= 157.5) { + if (features[2] <= 10.5) { + if (features[4] <= 35.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 13; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } else { + classes[0] = 19; + classes[1] = 0; + } + } else { + classes[0] = 21; + classes[1] = 0; + } + } else { + if (features[17] <= 0.5) { + if (features[7] <= 205.5) { + if (features[12] <= 9.5) { + classes[0] = 133; + classes[1] = 0; + } else { + if (features[7] <= 89.0) { + if (features[9] <= 11.0) { + classes[0] = 20; + classes[1] = 0; + } else { + if (features[16] <= 0.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 76; + classes[1] = 0; + } + } + } else { + if (features[9] <= 24.5) { + classes[0] = 79; + classes[1] = 0; + } else { + if (features[12] <= 13.5) { + if (features[12] <= 9.0) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[1] <= 153.0) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 37; + classes[1] = 0; + } + } + } + } else { + if (features[9] <= 11.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[15] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } else { + classes[0] = 160; + classes[1] = 0; + } + } else { + if (features[12] <= 8.5) { + if (features[18] <= 0.5) { + if (features[16] <= 0.5) { + classes[0] = 47; + classes[1] = 0; + } else { + if (features[17] <= 0.5) { + classes[0] = 31; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[13] <= 0.5) { + if (features[0] <= 53.0) { + if (features[12] <= 3.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[0] <= 11.5) { + if (features[14] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 18; + } + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + classes[0] = 287; + classes[1] = 0; + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 22; + classes[1] = 0; + } else { + if (features[2] <= 10.5) { + classes[0] = 0; + classes[1] = 7; + } else { + if (features[9] <= 20.0) { + classes[0] = 10; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } + } else { + if (features[9] <= 7.5) { + if (features[7] <= 94.0) { + if (features[9] <= 6.5) { + if (features[4] <= 361.0) { + if (features[3] <= 2.5) { + if (features[15] <= 0.5) { + if (features[9] <= 2.5) { + classes[0] = 47; + classes[1] = 0; + } else { + if (features[16] <= 2.5) { + if (features[9] <= 3.5) { + if (features[1] <= 76.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + classes[0] = 14; + classes[1] = 0; + } + } + } else { + classes[0] = 27; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[4] <= 46.0) { + if (features[0] <= 4.5) { + if (features[1] <= 89.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[18] <= 0.5) { + if (features[9] <= 3.5) { + if (features[12] <= 26.0) { + if (features[12] <= 0.5) { + if (features[1] <= 124.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[12] <= 4.5) { + if (features[0] <= 23.0) { + if (features[12] <= 2.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 23; + classes[1] = 0; + } + } + } else { + if (features[16] <= 3.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 11; + } + } + } else { + if (features[9] <= 6.5) { + classes[0] = 17; + classes[1] = 0; + } else { + if (features[4] <= 90.0) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } + } else { + if (features[17] <= 0.5) { + if (features[1] <= 192.0) { + if (features[14] <= 0.5) { + if (features[9] <= 62.5) { + if (features[0] <= 16.5) { + if (features[3] <= 0.5) { + if (features[11] <= 1.5) { + if (features[7] <= 21.0) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[15] <= 0.5) { + if (features[9] <= 15.5) { + if (features[1] <= 68.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 29; + } + } else { + if (features[12] <= 9.0) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[12] <= 21.0) { + if (features[12] <= 14.5) { + if (features[15] <= 2.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + if (features[13] <= 3.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[0] <= 9.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + if (features[7] <= 17.0) { + if (features[9] <= 26.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[0] <= 13.5) { + if (features[3] <= 1.5) { + if (features[16] <= 2.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + classes[0] = 0; + classes[1] = 40; + } + } else { + if (features[15] <= 4.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[2] <= 53.5) { + if (features[4] <= 218.0) { + if (features[2] <= 25.0) { + classes[0] = 13; + classes[1] = 0; + } else { + if (features[15] <= 1.5) { + if (features[2] <= 27.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 9; + classes[1] = 0; + } + } else { + if (features[16] <= 2.5) { + if (features[11] <= 1.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[0] <= 7.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 12; + classes[1] = 0; + } + } + } else { + if (features[0] <= 3.5) { + if (features[12] <= 16.0) { + if (features[4] <= 75.0) { + if (features[12] <= 6.0) { + classes[0] = 0; + classes[1] = 9; + } else { + if (features[1] <= 58.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[9] <= 18.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[4] <= 723.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } else { + if (features[2] <= 61.5) { + if (features[12] <= 4.5) { + if (features[1] <= 32.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[6] <= 2.5) { + if (features[4] <= 75.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[11] <= 0.5) { + if (features[7] <= 196.0) { + if (features[15] <= 2.5) { + classes[0] = 0; + classes[1] = 84; + } else { + if (features[9] <= 16.5) { + if (features[14] <= 4.0) { + if (features[16] <= 4.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[15] <= 3.5) { + if (features[7] <= 52.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + if (features[12] <= 6.0) { + if (features[1] <= 77.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 24; + } + } + } + } + } else { + if (features[9] <= 18.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[3] <= 0.5) { + if (features[0] <= 14.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[15] <= 4.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } else { + if (features[12] <= 17.0) { + if (features[0] <= 32.5) { + if (features[9] <= 28.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + if (features[12] <= 42.5) { + if (features[11] <= 4.0) { + if (features[1] <= 312.0) { + if (features[2] <= 18.5) { + if (features[9] <= 12.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[9] <= 39.0) { + if (features[7] <= 280.0) { + classes[0] = 0; + classes[1] = 14; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[14] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[13] <= 1.5) { + if (features[12] <= 21.0) { + if (features[12] <= 7.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[0] <= 6.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[2] <= 52.5) { + classes[0] = 0; + classes[1] = 9; + } else { + if (features[9] <= 23.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + if (features[9] <= 45.5) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[9] <= 91.0) { + if (features[1] <= 897.5) { + if (features[14] <= 0.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[13] <= 2.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + if (features[18] <= 0.5) { + if (features[0] <= 14.0) { + if (features[2] <= 47.5) { + if (features[0] <= 8.5) { + classes[0] = 15; + classes[1] = 0; + } else { + if (features[12] <= 51.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[1] <= 200.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 32; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + if (features[1] <= 404.0) { + if (features[16] <= 4.5) { + if (features[3] <= 0.5) { + if (features[14] <= 0.5) { + classes[0] = 0; + classes[1] = 31; + } else { + if (features[0] <= 0.5) { + if (features[9] <= 22.5) { + if (features[1] <= 195.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[7] <= 75.0) { + if (features[15] <= 10.0) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[9] <= 8.5) { + if (features[14] <= 4.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[16] <= 2.5) { + if (features[0] <= 30.5) { + classes[0] = 0; + classes[1] = 11; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 51; + } + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 38; + } + } else { + classes[0] = 0; + classes[1] = 77; + } + } else { + if (features[18] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_26(float features[]) { + int classes[2]; + + if (features[2] <= 7.5) { + if (features[4] <= 196.5) { + if (features[9] <= 20.5) { + if (features[7] <= 13.5) { + classes[0] = 205; + classes[1] = 0; + } else { + if (features[7] <= 14.5) { + if (features[0] <= 3.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[13] <= 0.5) { + if (features[12] <= 0.5) { + if (features[2] <= 6.5) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[8] <= 0.5) { + classes[0] = 68; + classes[1] = 0; + } else { + if (features[2] <= 5.0) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[9] <= 19.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 21; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 1.5) { + classes[0] = 35; + classes[1] = 0; + } else { + if (features[16] <= 3.0) { + if (features[12] <= 18.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } + } else { + if (features[4] <= 566.5) { + if (features[14] <= 0.5) { + if (features[16] <= 2.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 7; + } + } else { + if (features[2] <= 2.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + if (features[14] <= 0.5) { + if (features[16] <= 1.5) { + if (features[1] <= 92.5) { + if (features[3] <= 3.5) { + if (features[18] <= 0.5) { + if (features[8] <= 3.0) { + if (features[7] <= 198.5) { + classes[0] = 199; + classes[1] = 0; + } else { + if (features[0] <= 19.5) { + if (features[8] <= 0.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 12; + classes[1] = 0; + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[1] <= 63.5) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 23; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[7] <= 46.5) { + if (features[2] <= 9.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[1] <= 365.0) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 484; + classes[1] = 0; + } + } + } else { + if (features[7] <= 36.0) { + if (features[4] <= 625.0) { + if (features[2] <= 25.5) { + classes[0] = 22; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[9] <= 13.5) { + if (features[1] <= 305.0) { + if (features[16] <= 3.5) { + if (features[12] <= 0.5) { + if (features[16] <= 2.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[2] <= 57.5) { + if (features[1] <= 77.0) { + if (features[15] <= 2.5) { + if (features[9] <= 6.0) { + if (features[9] <= 2.0) { + classes[0] = 16; + classes[1] = 0; + } else { + if (features[9] <= 4.0) { + if (features[11] <= 1.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[11] <= 0.5) { + if (features[2] <= 19.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[1] <= 54.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 37; + classes[1] = 0; + } + } else { + if (features[18] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[2] <= 31.0) { + if (features[17] <= 0.5) { + if (features[3] <= 1.5) { + classes[0] = 16; + classes[1] = 0; + } else { + if (features[7] <= 427.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[1] <= 116.0) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[9] <= 2.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } + } else { + if (features[12] <= 49.5) { + if (features[7] <= 190.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 7; + } + } else { + if (features[0] <= 19.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } else { + if (features[0] <= 15.5) { + if (features[15] <= 8.5) { + if (features[13] <= 4.0) { + if (features[5] <= 13.0) { + if (features[1] <= 197.0) { + if (features[7] <= 238.0) { + if (features[7] <= 62.5) { + if (features[7] <= 61.0) { + classes[0] = 0; + classes[1] = 34; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 69; + } + } else { + if (features[11] <= 1.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[9] <= 123.0) { + if (features[10] <= 0.5) { + if (features[1] <= 247.0) { + if (features[1] <= 241.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[0] <= 9.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[13] <= 1.5) { + if (features[5] <= 0.5) { + if (features[18] <= 0.5) { + if (features[8] <= 4.0) { + if (features[4] <= 14.0) { + if (features[2] <= 25.5) { + classes[0] = 17; + classes[1] = 0; + } else { + if (features[2] <= 37.5) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[6] <= 2.5) { + if (features[2] <= 66.5) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[9] <= 17.5) { + if (features[16] <= 2.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[0] <= 41.0) { + classes[0] = 0; + classes[1] = 7; + } else { + if (features[11] <= 1.0) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } else { + if (features[1] <= 441.0) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[12] <= 11.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[16] <= 2.5) { + if (features[9] <= 41.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + classes[0] = 22; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[7] <= 202.5) { + if (features[7] <= 80.0) { + if (features[17] <= 0.5) { + if (features[7] <= 41.0) { + if (features[15] <= 1.5) { + if (features[0] <= 3.0) { + if (features[3] <= 0.5) { + if (features[9] <= 17.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[15] <= 0.5) { + if (features[14] <= 4.5) { + classes[0] = 0; + classes[1] = 14; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 11; + } + } + } else { + if (features[5] <= 2.5) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[3] <= 1.5) { + if (features[16] <= 1.5) { + classes[0] = 39; + classes[1] = 0; + } else { + if (features[9] <= 7.5) { + classes[0] = 11; + classes[1] = 0; + } else { + if (features[12] <= 27.5) { + if (features[16] <= 4.5) { + if (features[0] <= 4.5) { + if (features[9] <= 19.5) { + if (features[6] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[11] <= 1.0) { + if (features[2] <= 43.5) { + classes[0] = 0; + classes[1] = 10; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } else { + if (features[12] <= 7.5) { + if (features[11] <= 1.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + if (features[9] <= 6.0) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[9] <= 25.0) { + classes[0] = 0; + classes[1] = 33; + } else { + if (features[4] <= 75.0) { + if (features[2] <= 38.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } + } + } else { + if (features[17] <= 0.5) { + if (features[1] <= 316.5) { + if (features[3] <= 1.5) { + if (features[9] <= 7.5) { + if (features[12] <= 2.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[14] <= 2.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 13; + classes[1] = 0; + } + } + } else { + if (features[12] <= 4.5) { + if (features[16] <= 3.5) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[16] <= 1.5) { + if (features[12] <= 10.5) { + if (features[1] <= 84.0) { + if (features[16] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 19; + classes[1] = 0; + } + } else { + if (features[16] <= 2.5) { + if (features[3] <= 0.5) { + if (features[14] <= 12.5) { + if (features[2] <= 9.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 13; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[9] <= 50.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[0] <= 20.5) { + if (features[7] <= 90.5) { + if (features[2] <= 15.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 12; + } + } else { + classes[0] = 0; + classes[1] = 34; + } + } else { + if (features[1] <= 106.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 8; + } + } + } + } + } + } + } else { + if (features[14] <= 2.5) { + if (features[1] <= 40.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[0] <= 9.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 17; + } + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } + } else { + classes[0] = 12; + classes[1] = 0; + } + } else { + if (features[2] <= 70.0) { + classes[0] = 0; + classes[1] = 102; + } else { + if (features[15] <= 8.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } + } else { + if (features[4] <= 413.5) { + if (features[5] <= 0.5) { + if (features[2] <= 24.5) { + if (features[3] <= 0.5) { + if (features[7] <= 303.0) { + if (features[7] <= 296.5) { + if (features[16] <= 3.5) { + classes[0] = 31; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 34; + classes[1] = 0; + } + } else { + if (features[4] <= 165.0) { + if (features[9] <= 26.0) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[3] <= 1.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 47; + classes[1] = 0; + } else { + if (features[1] <= 54.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[2] <= 48.5) { + if (features[12] <= 44.5) { + if (features[0] <= 12.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[13] <= 30.0) { + if (features[12] <= 8.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 30; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[3] <= 2.0) { + if (features[15] <= 7.5) { + if (features[9] <= 20.5) { + if (features[14] <= 1.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[6] <= 5.0) { + if (features[2] <= 20.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 15; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 16; + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_27(float features[]) { + int classes[2]; + + if (features[3] <= 1.5) { + if (features[7] <= 24.5) { + if (features[9] <= 6.5) { + classes[0] = 250; + classes[1] = 0; + } else { + if (features[16] <= 2.5) { + classes[0] = 33; + classes[1] = 0; + } else { + if (features[16] <= 5.5) { + if (features[2] <= 5.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[1] <= 37.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[9] <= 19.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[12] <= 44.5) { + if (features[13] <= 0.5) { + if (features[14] <= 0.5) { + if (features[17] <= 0.5) { + if (features[4] <= 18.5) { + if (features[2] <= 14.5) { + if (features[16] <= 3.5) { + if (features[9] <= 1.5) { + classes[0] = 87; + classes[1] = 0; + } else { + if (features[1] <= 75.0) { + if (features[3] <= 0.5) { + if (features[2] <= 1.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[16] <= 1.5) { + if (features[15] <= 0.5) { + if (features[2] <= 11.5) { + classes[0] = 30; + classes[1] = 0; + } else { + if (features[2] <= 12.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + classes[0] = 14; + classes[1] = 0; + } + } else { + if (features[5] <= 0.5) { + if (features[2] <= 12.0) { + if (features[2] <= 8.0) { + if (features[7] <= 33.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[9] <= 7.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[7] <= 48.0) { + if (features[7] <= 45.5) { + classes[0] = 21; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 96; + classes[1] = 0; + } + } + } + } else { + if (features[2] <= 9.0) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[1] <= 84.5) { + if (features[9] <= 11.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 1.5) { + classes[0] = 245; + classes[1] = 0; + } else { + if (features[9] <= 13.5) { + if (features[2] <= 18.5) { + if (features[16] <= 2.5) { + if (features[7] <= 245.5) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[12] <= 3.5) { + if (features[1] <= 60.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 38; + classes[1] = 0; + } + } + } else { + if (features[11] <= 3.0) { + if (features[12] <= 34.0) { + if (features[7] <= 92.5) { + if (features[11] <= 0.5) { + if (features[1] <= 88.0) { + classes[0] = 0; + classes[1] = 16; + } else { + if (features[7] <= 66.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } else { + if (features[9] <= 17.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[16] <= 3.5) { + if (features[15] <= 7.0) { + if (features[16] <= 2.5) { + classes[0] = 0; + classes[1] = 10; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[8] <= 0.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } + } else { + if (features[0] <= 17.0) { + if (features[7] <= 31.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[4] <= 91.5) { + if (features[15] <= 6.0) { + classes[0] = 0; + classes[1] = 12; + } else { + if (features[2] <= 32.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[2] <= 31.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 17; + classes[1] = 0; + } + } + } else { + if (features[8] <= 31.5) { + if (features[16] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 58; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[17] <= 0.5) { + if (features[9] <= 21.5) { + if (features[15] <= 5.5) { + if (features[14] <= 8.5) { + if (features[0] <= 2.5) { + if (features[7] <= 69.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[3] <= 0.5) { + if (features[5] <= 0.5) { + if (features[2] <= 19.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[5] <= 2.0) { + if (features[9] <= 3.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[2] <= 39.0) { + if (features[4] <= 36.5) { + if (features[14] <= 5.5) { + if (features[16] <= 1.5) { + classes[0] = 25; + classes[1] = 0; + } else { + if (features[12] <= 18.0) { + if (features[8] <= 0.5) { + classes[0] = 0; + classes[1] = 9; + } else { + if (features[2] <= 29.5) { + if (features[9] <= 9.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[12] <= 20.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[2] <= 22.5) { + if (features[15] <= 2.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + if (features[16] <= 1.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } else { + if (features[12] <= 17.5) { + if (features[12] <= 10.5) { + if (features[1] <= 39.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } else { + if (features[11] <= 1.0) { + classes[0] = 0; + classes[1] = 10; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } else { + classes[0] = 42; + classes[1] = 0; + } + } else { + if (features[1] <= 179.0) { + classes[0] = 46; + classes[1] = 0; + } else { + if (features[16] <= 2.5) { + classes[0] = 20; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[16] <= 1.5) { + if (features[0] <= 18.5) { + if (features[1] <= 132.5) { + if (features[12] <= 4.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 45; + classes[1] = 0; + } + } else { + if (features[2] <= 63.5) { + if (features[4] <= 101.5) { + if (features[9] <= 109.0) { + if (features[14] <= 9.5) { + if (features[9] <= 28.5) { + classes[0] = 0; + classes[1] = 24; + } else { + if (features[7] <= 192.0) { + if (features[15] <= 11.5) { + if (features[15] <= 5.5) { + classes[0] = 0; + classes[1] = 35; + } else { + if (features[1] <= 74.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[5] <= 1.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[18] <= 0.5) { + if (features[14] <= 10.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[9] <= 26.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[1] <= 101.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } else { + if (features[3] <= 0.5) { + if (features[16] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[2] <= 12.0) { + classes[0] = 0; + classes[1] = 44; + } else { + if (features[1] <= 18.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[7] <= 251.0) { + if (features[1] <= 62.0) { + if (features[1] <= 55.5) { + classes[0] = 0; + classes[1] = 12; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 56; + } + } else { + if (features[0] <= 8.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[2] <= 21.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 12; + } + } + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 14; + } + } + } + } else { + if (features[17] <= 0.5) { + if (features[5] <= 0.5) { + if (features[7] <= 62.5) { + if (features[4] <= 82.0) { + if (features[2] <= 19.5) { + if (features[7] <= 36.0) { + if (features[16] <= 3.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 16; + classes[1] = 0; + } + } else { + if (features[0] <= 7.5) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 10; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + if (features[1] <= 248.5) { + if (features[7] <= 89.0) { + if (features[1] <= 124.0) { + classes[0] = 18; + classes[1] = 0; + } else { + if (features[0] <= 7.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } else { + if (features[0] <= 12.5) { + if (features[0] <= 11.5) { + classes[0] = 43; + classes[1] = 0; + } else { + if (features[13] <= 2.5) { + if (features[1] <= 162.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 75; + classes[1] = 0; + } + } + } else { + if (features[16] <= 3.5) { + classes[0] = 61; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } else { + if (features[9] <= 3.5) { + classes[0] = 0; + classes[1] = 10; + } else { + classes[0] = 13; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + if (features[1] <= 419.0) { + if (features[16] <= 2.5) { + if (features[1] <= 282.5) { + classes[0] = 29; + classes[1] = 0; + } else { + if (features[14] <= 8.0) { + if (features[7] <= 191.0) { + if (features[0] <= 75.0) { + if (features[12] <= 103.5) { + if (features[9] <= 4.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 21; + classes[1] = 0; + } + } else { + classes[0] = 12; + classes[1] = 0; + } + } + } else { + if (features[0] <= 20.0) { + if (features[0] <= 9.0) { + if (features[12] <= 66.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + if (features[13] <= 1.0) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 63; + classes[1] = 0; + } + } + } + } else { + if (features[5] <= 0.5) { + if (features[16] <= 2.5) { + if (features[2] <= 8.5) { + if (features[12] <= 4.5) { + if (features[12] <= 2.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[7] <= 18.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } else { + if (features[17] <= 0.5) { + if (features[0] <= 19.0) { + if (features[7] <= 257.0) { + if (features[12] <= 131.5) { + if (features[1] <= 82.0) { + if (features[12] <= 6.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + if (features[9] <= 17.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[18] <= 0.5) { + if (features[12] <= 113.0) { + classes[0] = 0; + classes[1] = 10; + } else { + if (features[0] <= 9.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 11; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 15; + } + } + } else { + if (features[8] <= 0.5) { + if (features[16] <= 5.5) { + if (features[4] <= 210.5) { + if (features[9] <= 40.5) { + if (features[14] <= 0.5) { + classes[0] = 0; + classes[1] = 9; + } else { + if (features[2] <= 8.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 8; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 50; + } + } else { + if (features[0] <= 12.0) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + if (features[1] <= 83.0) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[15] <= 2.5) { + if (features[9] <= 25.0) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[9] <= 87.0) { + if (features[8] <= 49.5) { + classes[0] = 0; + classes[1] = 11; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + if (features[7] <= 233.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 20; + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_28(float features[]) { + int classes[2]; + + if (features[16] <= 1.5) { + if (features[17] <= 0.5) { + if (features[0] <= 18.5) { + if (features[16] <= 0.5) { + classes[0] = 490; + classes[1] = 0; + } else { + if (features[9] <= 24.5) { + if (features[13] <= 0.5) { + if (features[7] <= 6.0) { + if (features[0] <= 2.5) { + classes[0] = 15; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[2] <= 11.5) { + if (features[8] <= 1.0) { + if (features[12] <= 10.0) { + classes[0] = 23; + classes[1] = 0; + } else { + if (features[2] <= 10.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 70; + classes[1] = 0; + } + } + } else { + classes[0] = 17; + classes[1] = 0; + } + } else { + if (features[2] <= 15.0) { + if (features[1] <= 51.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[3] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[0] <= 3.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[7] <= 1170.5) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } else { + classes[0] = 575; + classes[1] = 0; + } + } else { + if (features[12] <= 18.0) { + if (features[16] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 27; + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } else { + if (features[12] <= 1.5) { + if (features[16] <= 5.5) { + if (features[3] <= 0.5) { + if (features[14] <= 0.5) { + if (features[9] <= 6.5) { + classes[0] = 42; + classes[1] = 0; + } else { + if (features[16] <= 4.5) { + if (features[7] <= 112.5) { + classes[0] = 10; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[2] <= 8.0) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[0] <= 15.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + if (features[18] <= 0.5) { + if (features[13] <= 0.5) { + if (features[7] <= 117.5) { + if (features[7] <= 21.5) { + if (features[0] <= 1.5) { + if (features[15] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } else { + if (features[9] <= 12.5) { + if (features[1] <= 20.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[4] <= 329.5) { + if (features[0] <= 8.5) { + if (features[0] <= 5.5) { + if (features[1] <= 52.0) { + classes[0] = 14; + classes[1] = 0; + } else { + if (features[2] <= 20.0) { + if (features[16] <= 2.5) { + if (features[14] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[8] <= 1.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[5] <= 0.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 18; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[14] <= 7.5) { + if (features[12] <= 77.5) { + if (features[16] <= 2.5) { + if (features[14] <= 0.5) { + if (features[0] <= 13.5) { + if (features[1] <= 18.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[11] <= 0.5) { + if (features[7] <= 70.5) { + classes[0] = 0; + classes[1] = 12; + } else { + if (features[1] <= 69.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } else { + if (features[4] <= 406.0) { + if (features[2] <= 12.0) { + if (features[7] <= 42.0) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[9] <= 24.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[11] <= 3.0) { + if (features[4] <= 133.5) { + classes[0] = 0; + classes[1] = 28; + } else { + if (features[4] <= 161.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[9] <= 50.0) { + if (features[6] <= 5.5) { + if (features[0] <= 22.0) { + if (features[2] <= 5.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[7] <= 47.5) { + if (features[1] <= 117.0) { + if (features[11] <= 1.0) { + classes[0] = 0; + classes[1] = 28; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 92; + } + } + } else { + if (features[7] <= 53.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[0] <= 6.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[1] <= 145.5) { + if (features[12] <= 8.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[1] <= 128.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + if (features[9] <= 17.5) { + if (features[7] <= 220.5) { + if (features[7] <= 136.0) { + classes[0] = 12; + classes[1] = 0; + } else { + if (features[4] <= 165.0) { + if (features[15] <= 1.5) { + if (features[9] <= 2.5) { + if (features[12] <= 5.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[9] <= 6.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[7] <= 207.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[12] <= 5.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[14] <= 4.0) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[1] <= 93.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 26; + classes[1] = 0; + } + } else { + if (features[1] <= 129.5) { + if (features[12] <= 3.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[14] <= 2.5) { + if (features[2] <= 29.5) { + if (features[4] <= 236.0) { + if (features[12] <= 11.5) { + if (features[17] <= 0.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[7] <= 246.0) { + if (features[9] <= 41.0) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[1] <= 116.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[0] <= 20.0) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[4] <= 655.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 13; + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } + } else { + if (features[5] <= 0.5) { + if (features[3] <= 2.5) { + if (features[9] <= 18.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[17] <= 0.5) { + if (features[2] <= 68.5) { + if (features[8] <= 5.5) { + classes[0] = 38; + classes[1] = 0; + } else { + if (features[1] <= 243.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[8] <= 30.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[0] <= 22.0) { + classes[0] = 0; + classes[1] = 8; + } else { + if (features[12] <= 49.5) { + if (features[2] <= 29.0) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[14] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } + } + } else { + if (features[7] <= 410.5) { + if (features[0] <= 16.5) { + if (features[2] <= 16.5) { + if (features[3] <= 3.0) { + classes[0] = 24; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[14] <= 0.5) { + if (features[12] <= 6.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[12] <= 14.0) { + if (features[7] <= 265.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[4] <= 38.5) { + if (features[9] <= 15.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[2] <= 41.5) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[7] <= 167.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + if (features[1] <= 175.0) { + classes[0] = 0; + classes[1] = 8; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + if (features[3] <= 2.5) { + if (features[14] <= 0.5) { + classes[0] = 40; + classes[1] = 0; + } else { + if (features[12] <= 33.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + if (features[1] <= 156.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } else { + if (features[2] <= 40.5) { + if (features[12] <= 38.5) { + classes[0] = 0; + classes[1] = 12; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } + } else { + if (features[9] <= 8.5) { + if (features[7] <= 224.5) { + if (features[2] <= 81.0) { + classes[0] = 11; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[0] <= 0.5) { + if (features[12] <= 15.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[7] <= 255.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + if (features[2] <= 39.5) { + classes[0] = 0; + classes[1] = 125; + } else { + if (features[17] <= 0.5) { + if (features[16] <= 3.5) { + if (features[14] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[9] <= 27.5) { + if (features[7] <= 220.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } else { + classes[0] = 0; + classes[1] = 70; + } + } + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_29(float features[]) { + int classes[2]; + + if (features[16] <= 1.5) { + if (features[17] <= 0.5) { + if (features[4] <= 70.5) { + if (features[8] <= 0.5) { + if (features[1] <= 74.5) { + if (features[14] <= 0.5) { + if (features[9] <= 47.0) { + if (features[16] <= 0.5) { + classes[0] = 233; + classes[1] = 0; + } else { + if (features[2] <= 7.5) { + if (features[12] <= 3.5) { + classes[0] = 18; + classes[1] = 0; + } else { + if (features[12] <= 7.0) { + if (features[2] <= 4.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 79; + classes[1] = 0; + } + } + } else { + if (features[9] <= 53.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } else { + classes[0] = 27; + classes[1] = 0; + } + } else { + classes[0] = 584; + classes[1] = 0; + } + } else { + if (features[13] <= 0.5) { + if (features[1] <= 85.0) { + if (features[2] <= 12.5) { + if (features[9] <= 19.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 17; + classes[1] = 0; + } + } else { + classes[0] = 62; + classes[1] = 0; + } + } else { + classes[0] = 25; + classes[1] = 0; + } + } + } else { + if (features[1] <= 20.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[13] <= 0.5) { + if (features[14] <= 2.0) { + if (features[16] <= 0.5) { + classes[0] = 33; + classes[1] = 0; + } else { + if (features[9] <= 25.5) { + if (features[9] <= 16.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[2] <= 18.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } else { + classes[0] = 19; + classes[1] = 0; + } + } else { + classes[0] = 34; + classes[1] = 0; + } + } + } + } else { + if (features[1] <= 114.0) { + if (features[14] <= 6.0) { + classes[0] = 0; + classes[1] = 34; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } else { + if (features[13] <= 0.5) { + if (features[17] <= 0.5) { + if (features[1] <= 28.0) { + if (features[16] <= 5.5) { + if (features[2] <= 25.5) { + if (features[7] <= 29.5) { + classes[0] = 33; + classes[1] = 0; + } else { + if (features[7] <= 36.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + if (features[12] <= 3.0) { + if (features[2] <= 33.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[4] <= 20.0) { + if (features[11] <= 1.5) { + if (features[9] <= 13.5) { + if (features[14] <= 0.5) { + if (features[12] <= 4.5) { + if (features[7] <= 122.0) { + if (features[11] <= 0.5) { + if (features[1] <= 142.0) { + if (features[2] <= 15.0) { + if (features[9] <= 4.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + if (features[7] <= 181.5) { + if (features[9] <= 6.5) { + if (features[2] <= 1.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[12] <= 77.0) { + classes[0] = 27; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[15] <= 0.5) { + if (features[12] <= 7.5) { + if (features[1] <= 59.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + if (features[7] <= 79.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[12] <= 17.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + classes[0] = 11; + classes[1] = 0; + } + } + } else { + if (features[11] <= 0.5) { + if (features[12] <= 16.5) { + if (features[5] <= 0.5) { + if (features[1] <= 59.0) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[7] <= 90.0) { + classes[0] = 11; + classes[1] = 0; + } else { + if (features[8] <= 3.5) { + if (features[0] <= 31.0) { + if (features[16] <= 3.5) { + if (features[18] <= 0.5) { + if (features[14] <= 4.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[16] <= 6.0) { + classes[0] = 11; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[1] <= 178.0) { + if (features[2] <= 22.5) { + if (features[14] <= 12.5) { + if (features[7] <= 21.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[6] <= 0.5) { + if (features[14] <= 1.5) { + if (features[0] <= 11.5) { + if (features[5] <= 0.5) { + if (features[2] <= 13.5) { + classes[0] = 0; + classes[1] = 10; + } else { + if (features[1] <= 105.5) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[14] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[2] <= 16.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[15] <= 14.5) { + if (features[12] <= 35.0) { + if (features[12] <= 19.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[1] <= 114.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 12; + } + } else { + classes[0] = 0; + classes[1] = 18; + } + } + } else { + if (features[7] <= 71.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[2] <= 50.5) { + if (features[5] <= 0.5) { + if (features[1] <= 89.5) { + if (features[0] <= 13.0) { + classes[0] = 0; + classes[1] = 9; + } else { + if (features[7] <= 64.0) { + if (features[8] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } else { + classes[0] = 0; + classes[1] = 30; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + if (features[0] <= 47.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[1] <= 259.0) { + if (features[9] <= 17.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[2] <= 10.0) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[15] <= 0.5) { + if (features[0] <= 29.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } + } else { + if (features[0] <= 49.0) { + if (features[7] <= 187.5) { + classes[0] = 0; + classes[1] = 9; + } else { + if (features[16] <= 3.5) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[2] <= 27.0) { + classes[0] = 18; + classes[1] = 0; + } else { + if (features[15] <= 2.5) { + classes[0] = 8; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + if (features[8] <= 2.5) { + if (features[9] <= 6.5) { + if (features[0] <= 6.5) { + if (features[1] <= 56.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } else { + if (features[7] <= 185.0) { + if (features[9] <= 44.5) { + if (features[1] <= 486.0) { + if (features[7] <= 31.0) { + if (features[9] <= 15.0) { + classes[0] = 0; + classes[1] = 10; + } else { + if (features[16] <= 3.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[0] <= 3.0) { + if (features[4] <= 205.5) { + if (features[7] <= 69.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[1] <= 38.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } else { + classes[0] = 0; + classes[1] = 93; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[0] <= 5.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[9] <= 87.5) { + if (features[4] <= 238.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 8; + } + } else { + if (features[18] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + if (features[8] <= 0.5) { + if (features[12] <= 6.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[16] <= 5.5) { + if (features[14] <= 0.5) { + if (features[2] <= 22.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 12; + } + } else { + if (features[9] <= 30.0) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[12] <= 33.0) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[3] <= 2.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[5] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[14] <= 3.0) { + if (features[7] <= 226.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } + } + } else { + if (features[3] <= 8.5) { + if (features[0] <= 38.0) { + if (features[0] <= 5.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[0] <= 26.5) { + if (features[9] <= 97.0) { + classes[0] = 22; + classes[1] = 0; + } else { + if (features[3] <= 2.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[12] <= 32.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } + } + } else { + if (features[7] <= 396.0) { + if (features[9] <= 3.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[14] <= 0.5) { + if (features[9] <= 51.5) { + classes[0] = 0; + classes[1] = 41; + } else { + if (features[7] <= 125.5) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + if (features[7] <= 251.0) { + if (features[7] <= 73.5) { + if (features[16] <= 2.5) { + classes[0] = 0; + classes[1] = 14; + } else { + if (features[0] <= 8.0) { + classes[0] = 0; + classes[1] = 12; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[7] <= 131.5) { + classes[0] = 0; + classes[1] = 76; + } else { + if (features[7] <= 134.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 48; + } + } + } + } else { + if (features[15] <= 7.0) { + if (features[1] <= 181.0) { + if (features[14] <= 6.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } + } + } else { + if (features[12] <= 64.5) { + if (features[1] <= 206.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 3.5) { + if (features[13] <= 1.5) { + if (features[0] <= 17.5) { + if (features[0] <= 15.5) { + if (features[4] <= 40.0) { + if (features[8] <= 0.5) { + classes[0] = 15; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[15] <= 2.5) { + if (features[0] <= 16.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[17] <= 0.5) { + classes[0] = 22; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 35; + classes[1] = 0; + } + } else { + if (features[0] <= 25.5) { + if (features[4] <= 404.5) { + if (features[12] <= 4.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[3] <= 0.5) { + if (features[9] <= 13.0) { + classes[0] = 12; + classes[1] = 0; + } else { + if (features[11] <= 1.0) { + if (features[1] <= 124.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 13; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + if (features[2] <= 47.0) { + classes[0] = 0; + classes[1] = 14; + } else { + if (features[0] <= 28.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_30(float features[]) { + int classes[2]; + + if (features[16] <= 1.5) { + if (features[18] <= 0.5) { + if (features[17] <= 0.5) { + if (features[15] <= 0.5) { + if (features[3] <= 1.5) { + if (features[7] <= 195.0) { + if (features[1] <= 465.5) { + if (features[16] <= 0.5) { + classes[0] = 348; + classes[1] = 0; + } else { + if (features[12] <= 3.5) { + classes[0] = 71; + classes[1] = 0; + } else { + if (features[2] <= 7.5) { + if (features[7] <= 7.5) { + if (features[7] <= 4.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 14; + classes[1] = 0; + } + } else { + classes[0] = 40; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 13; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[4] <= 31.0) { + if (features[1] <= 85.0) { + if (features[7] <= 210.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + classes[0] = 119; + classes[1] = 0; + } + } else { + classes[0] = 13; + classes[1] = 0; + } + } + } else { + if (features[0] <= 3.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[7] <= 293.5) { + classes[0] = 15; + classes[1] = 0; + } else { + if (features[7] <= 306.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 356; + classes[1] = 0; + } + } else { + if (features[2] <= 11.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[9] <= 4.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[2] <= 29.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 184; + classes[1] = 0; + } else { + if (features[9] <= 8.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[17] <= 0.5) { + if (features[14] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 24; + } + } + } + } + } else { + if (features[4] <= 242.5) { + if (features[16] <= 4.5) { + if (features[18] <= 0.5) { + if (features[1] <= 129.0) { + if (features[2] <= 22.5) { + if (features[7] <= 32.5) { + if (features[1] <= 106.0) { + if (features[8] <= 0.5) { + if (features[3] <= 0.5) { + if (features[1] <= 46.0) { + classes[0] = 30; + classes[1] = 0; + } else { + if (features[13] <= 0.5) { + if (features[0] <= 5.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[1] <= 76.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 13; + classes[1] = 0; + } + } else { + if (features[15] <= 1.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[0] <= 2.5) { + if (features[9] <= 10.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[17] <= 0.5) { + if (features[3] <= 1.5) { + if (features[7] <= 43.5) { + if (features[12] <= 6.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[2] <= 15.5) { + if (features[7] <= 36.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[7] <= 39.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + if (features[14] <= 1.5) { + if (features[15] <= 0.5) { + if (features[7] <= 62.5) { + classes[0] = 13; + classes[1] = 0; + } else { + if (features[0] <= 3.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[7] <= 104.5) { + classes[0] = 12; + classes[1] = 0; + } else { + if (features[9] <= 13.0) { + if (features[2] <= 9.0) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[0] <= 12.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 28; + classes[1] = 0; + } + } else { + if (features[9] <= 10.0) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[12] <= 7.5) { + classes[0] = 0; + classes[1] = 7; + } else { + if (features[0] <= 3.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } + } else { + if (features[4] <= 222.5) { + if (features[1] <= 88.5) { + if (features[7] <= 174.5) { + classes[0] = 0; + classes[1] = 12; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 15; + } + } + } else { + if (features[1] <= 26.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[14] <= 3.5) { + if (features[11] <= 15.0) { + if (features[6] <= 0.5) { + if (features[14] <= 0.5) { + if (features[0] <= 13.5) { + if (features[9] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 29; + } + } else { + if (features[3] <= 0.5) { + if (features[1] <= 80.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[7] <= 207.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[1] <= 96.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + if (features[9] <= 9.0) { + if (features[9] <= 4.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[0] <= 5.5) { + if (features[4] <= 123.0) { + classes[0] = 0; + classes[1] = 7; + } else { + if (features[12] <= 16.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[1] <= 108.5) { + classes[0] = 0; + classes[1] = 42; + } else { + if (features[7] <= 246.0) { + classes[0] = 0; + classes[1] = 10; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[1] <= 54.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[4] <= 77.0) { + classes[0] = 11; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } + } else { + if (features[14] <= 0.5) { + if (features[5] <= 0.5) { + if (features[4] <= 223.5) { + if (features[0] <= 8.0) { + if (features[9] <= 28.0) { + if (features[1] <= 204.0) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[2] <= 18.0) { + if (features[9] <= 13.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[12] <= 9.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[9] <= 15.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + if (features[4] <= 38.5) { + if (features[8] <= 0.5) { + classes[0] = 47; + classes[1] = 0; + } else { + if (features[13] <= 1.5) { + if (features[9] <= 40.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } else { + if (features[4] <= 81.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 17; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } else { + if (features[14] <= 1.5) { + if (features[9] <= 40.0) { + if (features[12] <= 10.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[13] <= 0.5) { + if (features[4] <= 116.5) { + classes[0] = 0; + classes[1] = 20; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[12] <= 33.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[2] <= 34.0) { + classes[0] = 14; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[1] <= 133.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[15] <= 13.0) { + if (features[2] <= 31.5) { + classes[0] = 28; + classes[1] = 0; + } else { + if (features[15] <= 5.5) { + if (features[9] <= 14.5) { + if (features[16] <= 3.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[2] <= 38.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[0] <= 41.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } + } + } else { + if (features[0] <= 1.5) { + if (features[1] <= 193.5) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[1] <= 195.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[11] <= 1.0) { + if (features[12] <= 27.5) { + if (features[15] <= 2.5) { + if (features[2] <= 73.0) { + classes[0] = 0; + classes[1] = 67; + } else { + if (features[2] <= 75.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[7] <= 67.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[2] <= 43.5) { + classes[0] = 0; + classes[1] = 20; + } else { + if (features[1] <= 151.0) { + if (features[12] <= 13.5) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[14] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[16] <= 2.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[7] <= 264.5) { + if (features[8] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[2] <= 3.5) { + if (features[12] <= 1.0) { + if (features[4] <= 36.0) { + if (features[18] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[7] <= 25.5) { + if (features[6] <= 1.5) { + if (features[2] <= 10.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[12] <= 59.0) { + if (features[0] <= 66.5) { + if (features[17] <= 0.5) { + if (features[4] <= 8.0) { + if (features[9] <= 21.0) { + if (features[12] <= 7.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[0] <= 4.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + classes[0] = 0; + classes[1] = 31; + } + } else { + if (features[8] <= 2.5) { + if (features[3] <= 1.5) { + if (features[6] <= 1.5) { + if (features[2] <= 22.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[12] <= 27.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 74; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[1] <= 249.0) { + if (features[0] <= 40.5) { + if (features[2] <= 7.5) { + if (features[16] <= 2.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + if (features[1] <= 58.0) { + if (features[9] <= 9.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[16] <= 2.5) { + if (features[4] <= 428.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[0] <= 13.5) { + classes[0] = 0; + classes[1] = 42; + } else { + if (features[7] <= 341.5) { + classes[0] = 0; + classes[1] = 33; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } else { + if (features[1] <= 110.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + if (features[8] <= 0.5) { + classes[0] = 0; + classes[1] = 7; + } else { + if (features[0] <= 21.5) { + if (features[3] <= 3.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + if (features[2] <= 25.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[1] <= 385.5) { + if (features[8] <= 45.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_31(float features[]) { + int classes[2]; + + if (features[9] <= 11.5) { + if (features[16] <= 1.5) { + if (features[16] <= 0.5) { + classes[0] = 531; + classes[1] = 0; + } else { + if (features[2] <= 11.5) { + if (features[4] <= 90.0) { + if (features[0] <= 9.5) { + classes[0] = 28; + classes[1] = 0; + } else { + if (features[7] <= 50.5) { + if (features[7] <= 39.0) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 11; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 93; + classes[1] = 0; + } + } + } else { + if (features[15] <= 8.5) { + if (features[0] <= 57.0) { + if (features[17] <= 0.5) { + if (features[18] <= 0.5) { + if (features[8] <= 4.0) { + if (features[4] <= 90.5) { + if (features[2] <= 30.5) { + if (features[16] <= 2.5) { + if (features[9] <= 4.5) { + if (features[11] <= 0.5) { + if (features[0] <= 17.5) { + classes[0] = 22; + classes[1] = 0; + } else { + if (features[13] <= 1.5) { + if (features[7] <= 126.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[2] <= 18.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 15; + classes[1] = 0; + } + } else { + if (features[15] <= 1.5) { + if (features[1] <= 267.0) { + if (features[2] <= 10.0) { + if (features[2] <= 6.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 12; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[1] <= 54.5) { + if (features[7] <= 85.5) { + if (features[12] <= 0.5) { + if (features[1] <= 10.5) { + classes[0] = 8; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 16; + classes[1] = 0; + } + } else { + if (features[2] <= 29.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 39; + classes[1] = 0; + } + } + } else { + if (features[8] <= 1.5) { + if (features[9] <= 5.5) { + classes[0] = 14; + classes[1] = 0; + } else { + if (features[12] <= 16.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[1] <= 232.0) { + if (features[12] <= 8.5) { + if (features[0] <= 2.5) { + classes[0] = 11; + classes[1] = 0; + } else { + if (features[2] <= 34.0) { + if (features[4] <= 166.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[7] <= 146.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[14] <= 0.5) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[14] <= 0.5) { + if (features[2] <= 15.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[0] <= 0.5) { + if (features[3] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[12] <= 14.0) { + classes[0] = 0; + classes[1] = 7; + } else { + if (features[18] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + if (features[9] <= 2.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[0] <= 79.5) { + classes[0] = 0; + classes[1] = 7; + } else { + if (features[14] <= 3.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + if (features[1] <= 117.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[3] <= 0.5) { + classes[0] = 0; + classes[1] = 8; + } else { + if (features[9] <= 6.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } + } + } else { + if (features[17] <= 0.5) { + if (features[0] <= 18.5) { + if (features[12] <= 41.5) { + if (features[4] <= 235.0) { + if (features[4] <= 23.0) { + if (features[16] <= 1.5) { + if (features[9] <= 12.5) { + if (features[15] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + if (features[2] <= 45.0) { + if (features[1] <= 74.5) { + if (features[7] <= 193.5) { + classes[0] = 38; + classes[1] = 0; + } else { + if (features[7] <= 237.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 89; + classes[1] = 0; + } + } else { + if (features[16] <= 0.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[6] <= 4.0) { + if (features[11] <= 1.5) { + if (features[14] <= 0.5) { + if (features[9] <= 50.5) { + if (features[9] <= 16.5) { + if (features[12] <= 4.5) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[12] <= 10.5) { + if (features[0] <= 4.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[13] <= 0.5) { + if (features[9] <= 13.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[9] <= 14.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + if (features[0] <= 15.5) { + if (features[15] <= 4.0) { + if (features[5] <= 7.0) { + if (features[2] <= 5.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[16] <= 4.5) { + classes[0] = 0; + classes[1] = 30; + } else { + if (features[15] <= 0.5) { + classes[0] = 0; + classes[1] = 11; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[0] <= 14.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[0] <= 17.5) { + if (features[7] <= 151.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[7] <= 225.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[14] <= 11.5) { + if (features[2] <= 62.5) { + if (features[2] <= 7.5) { + if (features[7] <= 77.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[5] <= 0.5) { + if (features[9] <= 19.5) { + if (features[9] <= 18.5) { + classes[0] = 0; + classes[1] = 11; + } else { + if (features[2] <= 25.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + classes[0] = 0; + classes[1] = 34; + } + } else { + if (features[5] <= 1.5) { + if (features[16] <= 3.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[9] <= 17.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[12] <= 6.5) { + if (features[9] <= 21.5) { + if (features[2] <= 22.5) { + classes[0] = 12; + classes[1] = 0; + } else { + if (features[4] <= 87.0) { + if (features[4] <= 78.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } else { + if (features[7] <= 140.5) { + if (features[1] <= 258.0) { + if (features[2] <= 5.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[3] <= 1.5) { + if (features[7] <= 104.5) { + classes[0] = 0; + classes[1] = 32; + } else { + if (features[15] <= 4.0) { + if (features[2] <= 12.0) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[5] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[15] <= 4.5) { + if (features[8] <= 0.5) { + if (features[4] <= 201.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[9] <= 17.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[16] <= 2.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[7] <= 205.5) { + if (features[1] <= 170.0) { + classes[0] = 12; + classes[1] = 0; + } else { + if (features[0] <= 7.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[18] <= 0.5) { + if (features[7] <= 330.5) { + if (features[12] <= 29.0) { + classes[0] = 0; + classes[1] = 11; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[3] <= 1.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[2] <= 8.0) { + if (features[1] <= 76.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[2] <= 42.5) { + if (features[9] <= 16.0) { + if (features[2] <= 24.5) { + if (features[15] <= 1.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[7] <= 197.5) { + classes[0] = 0; + classes[1] = 44; + } else { + if (features[12] <= 22.0) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[5] <= 0.5) { + if (features[15] <= 11.5) { + classes[0] = 39; + classes[1] = 0; + } else { + if (features[12] <= 90.0) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[3] <= 3.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[4] <= 12.0) { + if (features[7] <= 108.0) { + if (features[1] <= 40.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[2] <= 41.0) { + if (features[9] <= 47.0) { + if (features[11] <= 0.5) { + if (features[12] <= 6.0) { + if (features[12] <= 4.0) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 30; + classes[1] = 0; + } + } else { + classes[0] = 11; + classes[1] = 0; + } + } else { + if (features[1] <= 123.5) { + if (features[16] <= 1.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + if (features[15] <= 8.0) { + if (features[13] <= 3.5) { + if (features[16] <= 1.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[8] <= 0.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[0] <= 36.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[16] <= 4.5) { + if (features[16] <= 1.5) { + classes[0] = 253; + classes[1] = 0; + } else { + if (features[5] <= 0.5) { + if (features[18] <= 0.5) { + if (features[14] <= 6.0) { + if (features[1] <= 165.5) { + if (features[12] <= 5.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[14] <= 0.5) { + classes[0] = 11; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 18; + classes[1] = 0; + } + } else { + if (features[15] <= 1.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[7] <= 285.0) { + if (features[7] <= 251.5) { + if (features[15] <= 8.0) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[7] <= 220.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[2] <= 31.5) { + if (features[4] <= 84.0) { + if (features[0] <= 22.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[1] <= 355.0) { + if (features[9] <= 137.5) { + classes[0] = 0; + classes[1] = 9; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[18] <= 0.5) { + if (features[8] <= 1.5) { + if (features[14] <= 0.5) { + classes[0] = 33; + classes[1] = 0; + } else { + if (features[9] <= 15.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[2] <= 19.5) { + classes[0] = 21; + classes[1] = 0; + } else { + if (features[4] <= 133.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + if (features[15] <= 5.0) { + if (features[1] <= 451.5) { + if (features[3] <= 5.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[16] <= 3.5) { + if (features[4] <= 1181.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[16] <= 2.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[9] <= 19.0) { + if (features[14] <= 3.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[13] <= 4.0) { + classes[0] = 0; + classes[1] = 13; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } + } else { + if (features[2] <= 28.5) { + if (features[12] <= 33.0) { + classes[0] = 0; + classes[1] = 109; + } else { + if (features[2] <= 15.5) { + if (features[7] <= 277.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 14; + } + } + } else { + if (features[7] <= 396.0) { + if (features[14] <= 78.5) { + if (features[8] <= 46.0) { + if (features[15] <= 5.0) { + classes[0] = 0; + classes[1] = 78; + } else { + if (features[1] <= 65.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[0] <= 41.5) { + classes[0] = 0; + classes[1] = 24; + } else { + if (features[2] <= 42.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[9] <= 36.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[1] <= 697.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_32(float features[]) { + int classes[2]; + + if (features[16] <= 1.5) { + if (features[9] <= 15.5) { + if (features[18] <= 0.5) { + if (features[17] <= 0.5) { + if (features[1] <= 467.5) { + if (features[9] <= 11.5) { + classes[0] = 544; + classes[1] = 0; + } else { + if (features[9] <= 12.5) { + if (features[13] <= 1.5) { + classes[0] = 19; + classes[1] = 0; + } else { + if (features[2] <= 11.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 67; + classes[1] = 0; + } + } + } else { + if (features[0] <= 10.5) { + if (features[9] <= 2.5) { + if (features[16] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 24; + classes[1] = 0; + } + } + } else { + if (features[0] <= 7.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 96; + classes[1] = 0; + } else { + if (features[8] <= 0.5) { + if (features[5] <= 0.5) { + if (features[1] <= 59.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[15] <= 1.5) { + if (features[0] <= 5.0) { + if (features[12] <= 14.5) { + if (features[12] <= 2.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[2] <= 13.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + if (features[17] <= 0.5) { + if (features[2] <= 34.5) { + classes[0] = 170; + classes[1] = 0; + } else { + if (features[16] <= 0.5) { + classes[0] = 51; + classes[1] = 0; + } else { + if (features[4] <= 148.0) { + if (features[7] <= 81.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[14] <= 0.5) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[18] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 189; + classes[1] = 0; + } else { + if (features[18] <= 0.5) { + if (features[17] <= 0.5) { + classes[0] = 27; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 0; + classes[1] = 34; + } + } + } + } + } else { + if (features[9] <= 8.5) { + if (features[2] <= 84.0) { + if (features[17] <= 0.5) { + if (features[15] <= 1.5) { + if (features[13] <= 3.5) { + if (features[1] <= 200.5) { + if (features[2] <= 17.5) { + if (features[1] <= 1.0) { + if (features[16] <= 5.5) { + classes[0] = 11; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[0] <= 5.5) { + if (features[7] <= 25.5) { + if (features[2] <= 7.0) { + if (features[3] <= 0.5) { + if (features[1] <= 17.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } else { + if (features[6] <= 0.5) { + if (features[3] <= 0.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 28; + classes[1] = 0; + } + } + } else { + if (features[13] <= 1.5) { + if (features[1] <= 43.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[9] <= 1.5) { + if (features[0] <= 22.5) { + if (features[9] <= 0.5) { + if (features[13] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[2] <= 21.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[4] <= 232.5) { + if (features[2] <= 34.5) { + if (features[9] <= 7.5) { + classes[0] = 8; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[12] <= 85.5) { + classes[0] = 32; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[12] <= 15.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 35; + classes[1] = 0; + } + } else { + if (features[2] <= 34.0) { + if (features[1] <= 25.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 8; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[16] <= 2.5) { + if (features[0] <= 37.5) { + if (features[1] <= 221.5) { + if (features[0] <= 1.5) { + if (features[9] <= 14.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + if (features[14] <= 0.5) { + if (features[7] <= 40.5) { + if (features[12] <= 18.0) { + classes[0] = 12; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[12] <= 30.0) { + if (features[17] <= 0.5) { + if (features[2] <= 8.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[12] <= 16.0) { + if (features[2] <= 47.0) { + if (features[1] <= 33.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 16; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[7] <= 92.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 11; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[7] <= 89.5) { + if (features[1] <= 140.5) { + if (features[2] <= 8.0) { + if (features[7] <= 42.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 50; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[0] <= 7.5) { + if (features[4] <= 78.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + if (features[14] <= 7.5) { + if (features[7] <= 114.0) { + if (features[12] <= 5.5) { + if (features[7] <= 101.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 22; + } + } else { + if (features[12] <= 2.5) { + if (features[2] <= 9.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } + } + } + } else { + if (features[13] <= 0.5) { + if (features[3] <= 7.5) { + if (features[3] <= 0.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[12] <= 62.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[0] <= 10.0) { + classes[0] = 15; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + if (features[0] <= 92.0) { + if (features[1] <= 120.0) { + if (features[7] <= 571.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 18; + classes[1] = 0; + } + } else { + if (features[1] <= 322.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + if (features[1] <= 308.0) { + if (features[7] <= 188.5) { + if (features[4] <= 9.5) { + if (features[1] <= 134.5) { + if (features[14] <= 0.5) { + if (features[13] <= 0.5) { + if (features[1] <= 119.5) { + if (features[8] <= 3.0) { + if (features[2] <= 4.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[0] <= 14.5) { + if (features[7] <= 15.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 38; + } + } else { + if (features[15] <= 7.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[1] <= 36.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 11; + classes[1] = 0; + } + } + } else { + if (features[6] <= 12.5) { + if (features[18] <= 0.5) { + if (features[15] <= 3.5) { + if (features[5] <= 0.5) { + classes[0] = 0; + classes[1] = 22; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[1] <= 67.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[5] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } else { + classes[0] = 0; + classes[1] = 40; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[12] <= 7.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[13] <= 0.5) { + classes[0] = 0; + classes[1] = 79; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[5] <= 12.5) { + if (features[13] <= 0.5) { + if (features[4] <= 188.5) { + if (features[0] <= 3.5) { + if (features[4] <= 177.5) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 48; + } + } else { + classes[0] = 0; + classes[1] = 64; + } + } else { + if (features[15] <= 2.5) { + classes[0] = 0; + classes[1] = 9; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[17] <= 0.5) { + if (features[0] <= 33.5) { + if (features[12] <= 27.5) { + if (features[12] <= 23.5) { + if (features[3] <= 3.0) { + if (features[7] <= 212.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[16] <= 3.5) { + if (features[12] <= 1.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 10; + classes[1] = 0; + } + } else { + if (features[15] <= 4.5) { + if (features[4] <= 48.5) { + if (features[14] <= 0.5) { + if (features[9] <= 26.5) { + if (features[9] <= 13.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[7] <= 268.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + if (features[7] <= 299.0) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[18] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } else { + if (features[0] <= 6.5) { + if (features[16] <= 3.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[12] <= 28.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 28; + } + } + } + } else { + if (features[4] <= 1666.0) { + if (features[12] <= 42.0) { + if (features[0] <= 118.5) { + if (features[0] <= 14.5) { + if (features[0] <= 8.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[13] <= 2.0) { + if (features[7] <= 89.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 9; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[14] <= 1.5) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[1] <= 435.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_33(float features[]) { + int classes[2]; + + if (features[16] <= 1.5) { + if (features[15] <= 1.5) { + if (features[4] <= 177.5) { + if (features[1] <= 465.5) { + if (features[9] <= 16.5) { + classes[0] = 569; + classes[1] = 0; + } else { + if (features[16] <= 0.5) { + classes[0] = 142; + classes[1] = 0; + } else { + if (features[17] <= 0.5) { + if (features[1] <= 135.5) { + if (features[0] <= 8.5) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[15] <= 0.5) { + if (features[1] <= 62.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 27; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[18] <= 0.5) { + if (features[16] <= 0.5) { + classes[0] = 35; + classes[1] = 0; + } else { + if (features[1] <= 498.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } + } else { + if (features[9] <= 9.0) { + if (features[7] <= 218.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[9] <= 15.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[9] <= 22.0) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[4] <= 222.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[17] <= 0.5) { + if (features[7] <= 73.0) { + if (features[15] <= 2.5) { + if (features[9] <= 19.0) { + classes[0] = 16; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 38; + classes[1] = 0; + } + } else { + classes[0] = 304; + classes[1] = 0; + } + } else { + if (features[15] <= 2.5) { + if (features[16] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 23; + } + } + } + } else { + if (features[9] <= 7.5) { + if (features[2] <= 38.0) { + if (features[12] <= 77.0) { + if (features[4] <= 361.0) { + if (features[15] <= 8.0) { + if (features[12] <= 0.5) { + if (features[7] <= 96.5) { + if (features[16] <= 5.5) { + classes[0] = 27; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[7] <= 343.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[7] <= 85.5) { + if (features[12] <= 8.5) { + classes[0] = 53; + classes[1] = 0; + } else { + if (features[2] <= 4.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 20; + classes[1] = 0; + } + } + } else { + if (features[2] <= 27.5) { + if (features[13] <= 0.5) { + if (features[16] <= 2.5) { + if (features[11] <= 0.5) { + if (features[9] <= 3.5) { + if (features[9] <= 2.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 14; + classes[1] = 0; + } + } else { + classes[0] = 12; + classes[1] = 0; + } + } else { + if (features[7] <= 99.0) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[8] <= 1.5) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } + } else { + if (features[15] <= 12.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[1] <= 460.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[2] <= 41.0) { + classes[0] = 0; + classes[1] = 8; + } else { + if (features[16] <= 4.5) { + if (features[1] <= 46.0) { + if (features[7] <= 72.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[2] <= 49.5) { + if (features[0] <= 25.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } else { + if (features[0] <= 49.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[16] <= 2.5) { + if (features[2] <= 21.5) { + if (features[18] <= 0.5) { + if (features[3] <= 3.5) { + if (features[1] <= 139.0) { + if (features[6] <= 0.5) { + if (features[8] <= 1.5) { + if (features[2] <= 8.5) { + if (features[0] <= 8.0) { + classes[0] = 11; + classes[1] = 0; + } else { + if (features[7] <= 42.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } else { + if (features[14] <= 0.5) { + if (features[8] <= 0.5) { + if (features[3] <= 0.5) { + if (features[2] <= 11.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[7] <= 107.5) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[12] <= 17.5) { + if (features[12] <= 12.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[0] <= 10.0) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[12] <= 28.0) { + if (features[15] <= 0.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[9] <= 36.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[2] <= 9.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } else { + classes[0] = 25; + classes[1] = 0; + } + } + } else { + if (features[7] <= 155.5) { + if (features[2] <= 8.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 11; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[13] <= 2.0) { + if (features[0] <= 59.5) { + if (features[8] <= 32.0) { + if (features[11] <= 3.5) { + if (features[12] <= 1.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[14] <= 7.5) { + if (features[14] <= 0.5) { + if (features[7] <= 120.5) { + if (features[12] <= 5.5) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[0] <= 16.5) { + classes[0] = 0; + classes[1] = 10; + } else { + if (features[18] <= 0.5) { + if (features[11] <= 1.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + if (features[15] <= 0.5) { + classes[0] = 0; + classes[1] = 29; + } else { + if (features[14] <= 1.5) { + if (features[15] <= 1.5) { + if (features[2] <= 40.5) { + classes[0] = 0; + classes[1] = 9; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 12; + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } + } else { + if (features[9] <= 41.5) { + classes[0] = 8; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[7] <= 857.5) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 14; + classes[1] = 0; + } + } + } else { + if (features[2] <= 65.5) { + if (features[7] <= 188.5) { + if (features[0] <= 18.5) { + if (features[16] <= 4.5) { + if (features[6] <= 4.5) { + if (features[7] <= 21.0) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[15] <= 4.5) { + if (features[15] <= 1.5) { + if (features[2] <= 5.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[9] <= 13.5) { + if (features[9] <= 10.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[2] <= 22.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[7] <= 96.5) { + if (features[2] <= 8.0) { + if (features[0] <= 10.0) { + classes[0] = 0; + classes[1] = 10; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 58; + } + } else { + if (features[9] <= 49.0) { + classes[0] = 0; + classes[1] = 13; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[4] <= 32.0) { + if (features[16] <= 3.5) { + if (features[9] <= 14.0) { + if (features[2] <= 15.0) { + if (features[15] <= 3.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 29; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 0; + classes[1] = 26; + } + } + } else { + if (features[0] <= 4.0) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[15] <= 12.5) { + if (features[9] <= 21.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[9] <= 11.0) { + if (features[14] <= 2.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 130; + } + } + } else { + if (features[18] <= 0.5) { + if (features[16] <= 4.5) { + if (features[7] <= 142.0) { + if (features[5] <= 0.5) { + if (features[0] <= 19.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[17] <= 0.5) { + classes[0] = 24; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[7] <= 162.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } else { + classes[0] = 0; + classes[1] = 28; + } + } + } else { + if (features[13] <= 1.5) { + if (features[3] <= 3.5) { + if (features[14] <= 6.0) { + if (features[1] <= 126.0) { + if (features[17] <= 0.5) { + if (features[7] <= 212.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 8; + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } else { + if (features[7] <= 321.5) { + if (features[16] <= 4.5) { + if (features[7] <= 234.5) { + if (features[9] <= 28.0) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[9] <= 35.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[15] <= 2.5) { + if (features[2] <= 28.0) { + if (features[13] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } else { + if (features[12] <= 7.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[0] <= 5.0) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[9] <= 19.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } else { + if (features[15] <= 8.0) { + if (features[14] <= 0.5) { + if (features[5] <= 1.0) { + if (features[7] <= 458.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[3] <= 1.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 12; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + classes[0] = 0; + classes[1] = 16; + } + } else { + if (features[12] <= 38.0) { + classes[0] = 0; + classes[1] = 21; + } else { + if (features[1] <= 459.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[7] <= 642.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } + } else { + if (features[17] <= 0.5) { + if (features[12] <= 61.5) { + classes[0] = 11; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_34(float features[]) { + int classes[2]; + + if (features[9] <= 11.5) { + if (features[4] <= 76.5) { + if (features[17] <= 0.5) { + if (features[5] <= 0.5) { + if (features[9] <= 10.5) { + if (features[2] <= 86.5) { + if (features[0] <= 16.5) { + if (features[16] <= 2.5) { + if (features[14] <= 0.5) { + if (features[12] <= 3.5) { + classes[0] = 263; + classes[1] = 0; + } else { + if (features[12] <= 4.5) { + if (features[2] <= 8.5) { + if (features[9] <= 2.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 18; + classes[1] = 0; + } + } else { + if (features[12] <= 9.5) { + if (features[15] <= 0.5) { + if (features[16] <= 1.5) { + classes[0] = 39; + classes[1] = 0; + } else { + if (features[11] <= 0.5) { + if (features[2] <= 4.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 13; + classes[1] = 0; + } + } else { + classes[0] = 88; + classes[1] = 0; + } + } + } + } else { + if (features[12] <= 11.0) { + classes[0] = 37; + classes[1] = 0; + } else { + if (features[12] <= 12.5) { + if (features[1] <= 80.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 12; + classes[1] = 0; + } + } + } + } else { + if (features[18] <= 0.5) { + if (features[12] <= 6.5) { + if (features[2] <= 22.0) { + if (features[1] <= 10.5) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[7] <= 17.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[0] <= 5.0) { + if (features[9] <= 4.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + if (features[0] <= 14.0) { + classes[0] = 24; + classes[1] = 0; + } else { + if (features[9] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 276; + classes[1] = 0; + } + } else { + if (features[18] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[0] <= 4.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[13] <= 0.5) { + if (features[14] <= 1.5) { + if (features[2] <= 43.0) { + classes[0] = 17; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[14] <= 20.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } + } else { + if (features[1] <= 172.0) { + classes[0] = 13; + classes[1] = 0; + } else { + if (features[16] <= 1.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } + } else { + if (features[16] <= 2.5) { + if (features[14] <= 3.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[8] <= 5.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[1] <= 87.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[18] <= 0.5) { + if (features[8] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 0; + classes[1] = 11; + } + } + } + } + } else { + if (features[7] <= 92.0) { + if (features[15] <= 3.5) { + if (features[7] <= 30.5) { + if (features[8] <= 1.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 11; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[16] <= 3.5) { + if (features[15] <= 0.5) { + if (features[17] <= 0.5) { + classes[0] = 17; + classes[1] = 0; + } else { + if (features[0] <= 12.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + if (features[7] <= 136.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[5] <= 9.5) { + if (features[2] <= 65.0) { + classes[0] = 0; + classes[1] = 8; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[17] <= 0.5) { + if (features[16] <= 1.5) { + if (features[1] <= 97.0) { + if (features[9] <= 32.5) { + if (features[18] <= 0.5) { + if (features[16] <= 0.5) { + classes[0] = 71; + classes[1] = 0; + } else { + if (features[12] <= 7.5) { + classes[0] = 18; + classes[1] = 0; + } else { + if (features[12] <= 8.5) { + if (features[2] <= 15.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } + } else { + if (features[2] <= 40.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[14] <= 0.5) { + if (features[1] <= 51.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[12] <= 18.5) { + if (features[0] <= 26.0) { + classes[0] = 0; + classes[1] = 13; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 360; + classes[1] = 0; + } else { + if (features[4] <= 148.0) { + classes[0] = 38; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[1] <= 216.5) { + if (features[0] <= 11.5) { + if (features[7] <= 18.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[14] <= 7.5) { + if (features[15] <= 5.5) { + if (features[6] <= 4.0) { + if (features[7] <= 24.0) { + if (features[2] <= 5.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[4] <= 148.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[3] <= 3.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[3] <= 0.5) { + if (features[0] <= 7.5) { + if (features[9] <= 47.5) { + classes[0] = 0; + classes[1] = 43; + } else { + if (features[9] <= 176.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[7] <= 55.5) { + if (features[6] <= 0.5) { + if (features[12] <= 5.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[14] <= 0.5) { + if (features[12] <= 13.0) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 12; + } + } + } + } else { + classes[0] = 0; + classes[1] = 47; + } + } + } else { + if (features[4] <= 163.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[6] <= 0.5) { + if (features[1] <= 185.0) { + classes[0] = 0; + classes[1] = 7; + } else { + if (features[15] <= 6.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[7] <= 170.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + if (features[3] <= 2.0) { + if (features[9] <= 28.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[12] <= 3.5) { + if (features[0] <= 17.0) { + if (features[15] <= 1.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 13; + classes[1] = 0; + } + } else { + if (features[7] <= 182.5) { + if (features[13] <= 1.5) { + if (features[1] <= 60.5) { + if (features[3] <= 0.5) { + if (features[7] <= 81.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[1] <= 45.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[5] <= 0.5) { + if (features[2] <= 7.5) { + if (features[7] <= 133.0) { + if (features[15] <= 2.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[12] <= 21.0) { + if (features[0] <= 22.5) { + if (features[16] <= 3.5) { + if (features[14] <= 8.0) { + if (features[8] <= 2.5) { + if (features[9] <= 40.0) { + classes[0] = 0; + classes[1] = 17; + } else { + if (features[2] <= 39.0) { + if (features[11] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 15; + } + } else { + if (features[7] <= 81.5) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[13] <= 0.5) { + if (features[2] <= 20.0) { + if (features[15] <= 9.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[7] <= 82.0) { + if (features[2] <= 21.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 33; + } + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[12] <= 19.5) { + if (features[3] <= 5.0) { + if (features[2] <= 24.0) { + if (features[1] <= 120.0) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[7] <= 274.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[12] <= 8.5) { + if (features[1] <= 113.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[16] <= 4.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[4] <= 98.5) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[0] <= 15.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[2] <= 75.0) { + if (features[9] <= 110.5) { + classes[0] = 22; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } + } else { + if (features[16] <= 3.5) { + if (features[1] <= 374.5) { + if (features[0] <= 8.5) { + classes[0] = 11; + classes[1] = 0; + } else { + if (features[11] <= 2.5) { + if (features[0] <= 23.5) { + if (features[3] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[14] <= 0.5) { + if (features[11] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } else { + if (features[15] <= 4.5) { + if (features[8] <= 0.5) { + if (features[9] <= 142.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[15] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } else { + classes[0] = 29; + classes[1] = 0; + } + } else { + if (features[18] <= 0.5) { + if (features[4] <= 419.5) { + if (features[2] <= 19.5) { + if (features[13] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[0] <= 6.0) { + if (features[7] <= 268.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 12; + classes[1] = 0; + } + } else { + if (features[9] <= 105.5) { + classes[0] = 0; + classes[1] = 12; + } else { + if (features[4] <= 1149.5) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } + } + } else { + if (features[0] <= 71.0) { + if (features[9] <= 273.0) { + if (features[8] <= 46.0) { + if (features[0] <= 0.5) { + if (features[3] <= 2.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[14] <= 11.5) { + classes[0] = 0; + classes[1] = 202; + } else { + if (features[1] <= 190.5) { + if (features[1] <= 154.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[9] <= 405.0) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_35(float features[]) { + int classes[2]; + + if (features[9] <= 11.5) { + if (features[4] <= 89.5) { + if (features[2] <= 27.5) { + if (features[7] <= 32.5) { + if (features[7] <= 0.5) { + if (features[16] <= 5.5) { + classes[0] = 93; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 188; + classes[1] = 0; + } + } else { + if (features[13] <= 0.5) { + if (features[9] <= 0.5) { + classes[0] = 92; + classes[1] = 0; + } else { + if (features[16] <= 1.5) { + if (features[12] <= 3.5) { + if (features[14] <= 1.0) { + classes[0] = 41; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[0] <= 10.5) { + if (features[12] <= 11.5) { + if (features[8] <= 0.5) { + if (features[0] <= 9.5) { + classes[0] = 27; + classes[1] = 0; + } else { + if (features[12] <= 9.0) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 37; + classes[1] = 0; + } + } else { + classes[0] = 77; + classes[1] = 0; + } + } + } else { + if (features[15] <= 7.5) { + if (features[17] <= 0.5) { + if (features[7] <= 37.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[9] <= 8.0) { + if (features[12] <= 0.5) { + if (features[0] <= 31.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[12] <= 77.0) { + if (features[14] <= 0.5) { + classes[0] = 25; + classes[1] = 0; + } else { + if (features[11] <= 0.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[0] <= 4.5) { + if (features[9] <= 3.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + if (features[2] <= 13.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 86; + classes[1] = 0; + } + } + } else { + if (features[16] <= 1.5) { + classes[0] = 162; + classes[1] = 0; + } else { + if (features[8] <= 1.5) { + if (features[1] <= 53.0) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[12] <= 29.5) { + if (features[4] <= 83.0) { + if (features[12] <= 8.5) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[0] <= 2.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[9] <= 8.5) { + if (features[0] <= 51.0) { + if (features[1] <= 102.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[2] <= 70.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } else { + if (features[1] <= 97.5) { + if (features[1] <= 66.0) { + if (features[11] <= 0.5) { + if (features[12] <= 4.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[7] <= 62.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + if (features[1] <= 82.5) { + classes[0] = 0; + classes[1] = 9; + } else { + if (features[2] <= 26.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } else { + if (features[5] <= 0.5) { + classes[0] = 13; + classes[1] = 0; + } else { + if (features[3] <= 1.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } + } else { + if (features[3] <= 2.5) { + if (features[17] <= 0.5) { + if (features[12] <= 40.5) { + if (features[3] <= 0.5) { + if (features[0] <= 18.5) { + if (features[1] <= 169.0) { + if (features[1] <= 24.5) { + classes[0] = 14; + classes[1] = 0; + } else { + if (features[14] <= 12.5) { + if (features[13] <= 2.5) { + if (features[6] <= 2.5) { + if (features[8] <= 1.5) { + if (features[9] <= 19.5) { + if (features[18] <= 0.5) { + if (features[7] <= 50.5) { + if (features[7] <= 20.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[6] <= 0.5) { + if (features[16] <= 1.0) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[1] <= 55.5) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[12] <= 8.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[1] <= 146.0) { + if (features[15] <= 1.5) { + if (features[0] <= 7.5) { + if (features[16] <= 2.0) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[13] <= 0.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 13; + classes[1] = 0; + } + } else { + classes[0] = 13; + classes[1] = 0; + } + } else { + if (features[16] <= 1.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + if (features[7] <= 145.0) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[2] <= 19.0) { + if (features[1] <= 36.0) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[0] <= 9.0) { + if (features[15] <= 8.5) { + if (features[15] <= 0.5) { + if (features[11] <= 0.5) { + classes[0] = 0; + classes[1] = 10; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[2] <= 17.5) { + if (features[12] <= 32.0) { + if (features[12] <= 17.0) { + if (features[12] <= 10.0) { + if (features[11] <= 0.5) { + if (features[7] <= 169.0) { + if (features[7] <= 58.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + if (features[16] <= 1.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 11; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } + } else { + if (features[9] <= 38.5) { + if (features[0] <= 8.5) { + classes[0] = 0; + classes[1] = 21; + } else { + if (features[16] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[9] <= 24.5) { + if (features[12] <= 13.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 11; + } + } + } + } else { + if (features[16] <= 1.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } + } else { + if (features[1] <= 42.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[7] <= 125.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[16] <= 5.0) { + classes[0] = 11; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } else { + if (features[16] <= 3.5) { + classes[0] = 37; + classes[1] = 0; + } else { + if (features[14] <= 0.5) { + if (features[1] <= 254.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } + } else { + if (features[18] <= 0.5) { + if (features[16] <= 1.5) { + classes[0] = 184; + classes[1] = 0; + } else { + if (features[9] <= 25.5) { + if (features[2] <= 28.5) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[2] <= 35.5) { + if (features[9] <= 13.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + if (features[0] <= 32.5) { + if (features[2] <= 20.0) { + if (features[5] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[14] <= 0.5) { + if (features[1] <= 129.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } + } else { + if (features[1] <= 125.5) { + if (features[1] <= 67.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } + } + } else { + if (features[15] <= 1.5) { + if (features[16] <= 1.0) { + classes[0] = 12; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 19; + } + } else { + if (features[1] <= 184.5) { + if (features[15] <= 14.0) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[1] <= 159.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + classes[0] = 23; + classes[1] = 0; + } + } + } + } + } else { + if (features[16] <= 1.5) { + if (features[1] <= 90.5) { + if (features[2] <= 32.0) { + if (features[15] <= 0.5) { + if (features[0] <= 4.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 18; + classes[1] = 0; + } + } else { + if (features[4] <= 91.5) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 37; + classes[1] = 0; + } + } else { + if (features[2] <= 5.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[6] <= 1.5) { + if (features[4] <= 85.5) { + if (features[7] <= 227.0) { + classes[0] = 0; + classes[1] = 25; + } else { + if (features[14] <= 0.5) { + if (features[7] <= 287.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[15] <= 4.5) { + if (features[0] <= 11.0) { + if (features[7] <= 19.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[15] <= 0.5) { + if (features[5] <= 12.0) { + if (features[7] <= 160.5) { + if (features[12] <= 6.5) { + if (features[7] <= 27.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } + } else { + if (features[3] <= 1.5) { + if (features[0] <= 34.5) { + if (features[6] <= 0.5) { + if (features[7] <= 213.0) { + classes[0] = 11; + classes[1] = 0; + } else { + if (features[4] <= 196.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[8] <= 3.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } + } + } else { + if (features[5] <= 0.5) { + if (features[18] <= 0.5) { + if (features[7] <= 187.5) { + if (features[14] <= 3.5) { + classes[0] = 30; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 63; + classes[1] = 0; + } + } else { + if (features[1] <= 300.0) { + if (features[0] <= 16.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[0] <= 57.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 23; + classes[1] = 0; + } + } + } else { + if (features[12] <= 96.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[1] <= 426.5) { + if (features[12] <= 27.5) { + if (features[8] <= 32.5) { + classes[0] = 0; + classes[1] = 188; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[0] <= 1.0) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[7] <= 242.0) { + if (features[7] <= 200.5) { + classes[0] = 0; + classes[1] = 11; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 21; + } + } + } + } else { + if (features[12] <= 26.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } else { + if (features[6] <= 0.5) { + if (features[1] <= 198.5) { + if (features[9] <= 15.5) { + if (features[16] <= 2.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[4] <= 111.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[3] <= 8.5) { + if (features[1] <= 33.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[9] <= 72.0) { + if (features[0] <= 18.5) { + classes[0] = 0; + classes[1] = 30; + } else { + if (features[9] <= 49.0) { + classes[0] = 0; + classes[1] = 14; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[13] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[7] <= 28.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[4] <= 937.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[2] <= 15.5) { + if (features[0] <= 9.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } + } + } + } else { + if (features[16] <= 3.5) { + if (features[13] <= 0.5) { + if (features[7] <= 171.0) { + if (features[8] <= 5.5) { + if (features[8] <= 2.5) { + if (features[3] <= 4.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[0] <= 10.0) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[16] <= 2.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[0] <= 25.0) { + classes[0] = 0; + classes[1] = 11; + } else { + if (features[16] <= 4.5) { + if (features[1] <= 368.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[12] <= 40.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 13; + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_36(float features[]) { + int classes[2]; + + if (features[17] <= 0.5) { + if (features[9] <= 13.5) { + if (features[14] <= 0.5) { + if (features[3] <= 1.5) { + if (features[16] <= 3.5) { + if (features[1] <= 371.5) { + if (features[4] <= 9.5) { + if (features[16] <= 1.5) { + classes[0] = 555; + classes[1] = 0; + } else { + if (features[12] <= 7.5) { + if (features[1] <= 57.0) { + if (features[2] <= 9.5) { + if (features[9] <= 7.5) { + classes[0] = 17; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[15] <= 0.5) { + if (features[2] <= 31.5) { + if (features[12] <= 4.0) { + if (features[2] <= 14.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[9] <= 6.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 25; + classes[1] = 0; + } + } else { + classes[0] = 46; + classes[1] = 0; + } + } + } else { + if (features[16] <= 2.5) { + if (features[7] <= 40.5) { + if (features[11] <= 2.0) { + if (features[15] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 16; + classes[1] = 0; + } + } else { + if (features[4] <= 54.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[15] <= 0.5) { + if (features[0] <= 10.5) { + if (features[1] <= 464.0) { + if (features[12] <= 53.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[2] <= 12.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 30; + classes[1] = 0; + } + } else { + classes[0] = 20; + classes[1] = 0; + } + } + } else { + if (features[15] <= 0.5) { + if (features[5] <= 0.5) { + if (features[18] <= 0.5) { + if (features[2] <= 38.0) { + if (features[16] <= 4.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[7] <= 13.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[16] <= 5.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + classes[0] = 13; + classes[1] = 0; + } + } + } else { + if (features[2] <= 25.5) { + if (features[16] <= 3.0) { + if (features[3] <= 6.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[2] <= 28.5) { + if (features[4] <= 79.0) { + if (features[8] <= 4.0) { + if (features[16] <= 4.0) { + classes[0] = 85; + classes[1] = 0; + } else { + if (features[2] <= 21.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[15] <= 14.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[6] <= 0.5) { + if (features[12] <= 3.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[14] <= 2.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[18] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + if (features[16] <= 1.0) { + classes[0] = 32; + classes[1] = 0; + } else { + if (features[1] <= 244.5) { + if (features[8] <= 0.5) { + if (features[4] <= 179.0) { + classes[0] = 0; + classes[1] = 22; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[7] <= 503.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } + } else { + if (features[16] <= 1.5) { + if (features[16] <= 0.5) { + classes[0] = 426; + classes[1] = 0; + } else { + if (features[7] <= 203.0) { + if (features[1] <= 51.0) { + classes[0] = 39; + classes[1] = 0; + } else { + if (features[0] <= 17.5) { + if (features[9] <= 14.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[15] <= 1.0) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[0] <= 11.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 22; + classes[1] = 0; + } + } + } else { + if (features[7] <= 219.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[2] <= 34.5) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[11] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[12] <= 42.5) { + if (features[7] <= 156.5) { + if (features[1] <= 24.5) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[11] <= 3.5) { + if (features[13] <= 4.5) { + if (features[9] <= 44.5) { + if (features[16] <= 2.5) { + if (features[8] <= 0.5) { + if (features[0] <= 1.5) { + if (features[2] <= 25.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[7] <= 89.5) { + if (features[2] <= 14.5) { + if (features[1] <= 70.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[0] <= 4.0) { + if (features[2] <= 25.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 16; + } + } + } else { + if (features[9] <= 30.0) { + if (features[12] <= 7.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[0] <= 14.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + classes[0] = 0; + classes[1] = 15; + } + } else { + if (features[0] <= 22.5) { + if (features[2] <= 56.0) { + if (features[1] <= 53.5) { + if (features[9] <= 25.0) { + if (features[12] <= 8.5) { + if (features[1] <= 45.5) { + if (features[12] <= 6.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 17; + } + } else { + if (features[5] <= 0.5) { + if (features[15] <= 8.0) { + classes[0] = 0; + classes[1] = 124; + } else { + if (features[14] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[2] <= 13.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[7] <= 50.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[7] <= 126.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[7] <= 145.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } + } else { + if (features[2] <= 14.5) { + if (features[9] <= 62.5) { + if (features[9] <= 46.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[9] <= 53.5) { + if (features[15] <= 1.0) { + if (features[13] <= 0.5) { + if (features[4] <= 116.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[12] <= 7.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 18; + } + } + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[9] <= 22.0) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[12] <= 2.0) { + if (features[2] <= 2.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } + } else { + if (features[16] <= 3.5) { + if (features[4] <= 1117.0) { + if (features[7] <= 316.5) { + if (features[15] <= 2.5) { + classes[0] = 25; + classes[1] = 0; + } else { + if (features[3] <= 0.5) { + if (features[2] <= 26.0) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[14] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 8; + } + } + } + } else { + if (features[13] <= 2.5) { + if (features[9] <= 144.0) { + if (features[9] <= 54.5) { + if (features[16] <= 2.5) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[18] <= 0.5) { + if (features[0] <= 8.0) { + if (features[12] <= 9.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[16] <= 4.5) { + if (features[7] <= 280.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[8] <= 1.5) { + if (features[12] <= 24.0) { + if (features[9] <= 34.0) { + if (features[15] <= 2.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[4] <= 98.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[1] <= 406.0) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[0] <= 72.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[15] <= 15.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[12] <= 28.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } + } + } else { + if (features[2] <= 30.5) { + if (features[4] <= 267.5) { + if (features[0] <= 24.0) { + classes[0] = 27; + classes[1] = 0; + } else { + if (features[15] <= 29.0) { + if (features[0] <= 28.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[8] <= 2.5) { + if (features[12] <= 50.0) { + if (features[7] <= 141.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + if (features[12] <= 105.0) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[9] <= 92.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + if (features[16] <= 5.0) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[0] <= 19.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } + } else { + if (features[0] <= 0.5) { + if (features[9] <= 15.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + if (features[0] <= 71.0) { + if (features[7] <= 1274.5) { + if (features[16] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[2] <= 73.0) { + if (features[8] <= 46.0) { + if (features[14] <= 11.5) { + if (features[2] <= 37.5) { + classes[0] = 0; + classes[1] = 155; + } else { + if (features[2] <= 38.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[2] <= 41.5) { + if (features[9] <= 54.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 53; + } + } + } + } else { + if (features[9] <= 15.0) { + classes[0] = 0; + classes[1] = 8; + } else { + if (features[5] <= 0.5) { + if (features[9] <= 23.0) { + if (features[15] <= 7.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[0] <= 11.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 9; + } + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[1] <= 540.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_37(float features[]) { + int classes[2]; + + if (features[18] <= 0.5) { + if (features[3] <= 0.5) { + if (features[14] <= 0.5) { + if (features[9] <= 16.5) { + if (features[9] <= 0.5) { + if (features[11] <= 0.5) { + if (features[12] <= 3.5) { + classes[0] = 144; + classes[1] = 0; + } else { + if (features[13] <= 0.5) { + if (features[12] <= 4.5) { + if (features[7] <= 58.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 25; + classes[1] = 0; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + classes[0] = 40; + classes[1] = 0; + } + } else { + if (features[17] <= 0.5) { + if (features[11] <= 0.5) { + if (features[9] <= 3.5) { + if (features[7] <= 82.0) { + if (features[16] <= 0.5) { + classes[0] = 65; + classes[1] = 0; + } else { + if (features[1] <= 313.0) { + if (features[12] <= 8.5) { + classes[0] = 22; + classes[1] = 0; + } else { + if (features[2] <= 7.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 12; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[12] <= 0.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[5] <= 0.5) { + if (features[7] <= 87.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[12] <= 4.5) { + if (features[9] <= 2.5) { + classes[0] = 12; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 31; + classes[1] = 0; + } + } + } else { + if (features[13] <= 2.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + if (features[0] <= 5.5) { + if (features[16] <= 2.5) { + if (features[15] <= 0.5) { + if (features[7] <= 145.5) { + classes[0] = 50; + classes[1] = 0; + } else { + if (features[7] <= 260.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 20; + classes[1] = 0; + } + } else { + if (features[12] <= 3.0) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[2] <= 29.5) { + if (features[12] <= 8.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[16] <= 3.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 150; + classes[1] = 0; + } + } + } else { + classes[0] = 101; + classes[1] = 0; + } + } else { + if (features[15] <= 1.0) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[1] <= 205.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[0] <= 15.5) { + if (features[7] <= 89.0) { + if (features[16] <= 2.5) { + classes[0] = 18; + classes[1] = 0; + } else { + if (features[7] <= 52.5) { + if (features[16] <= 3.5) { + if (features[12] <= 5.5) { + if (features[2] <= 6.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[12] <= 12.0) { + if (features[12] <= 7.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + classes[0] = 0; + classes[1] = 22; + } + } + } else { + if (features[17] <= 0.5) { + if (features[2] <= 21.5) { + if (features[16] <= 0.5) { + classes[0] = 27; + classes[1] = 0; + } else { + if (features[1] <= 71.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[1] <= 156.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 1.5) { + classes[0] = 16; + classes[1] = 0; + } else { + if (features[7] <= 289.5) { + classes[0] = 0; + classes[1] = 8; + } else { + if (features[12] <= 27.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[16] <= 4.5) { + if (features[16] <= 2.5) { + classes[0] = 183; + classes[1] = 0; + } else { + if (features[1] <= 168.0) { + if (features[0] <= 23.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[2] <= 19.5) { + if (features[7] <= 152.5) { + if (features[8] <= 0.5) { + if (features[16] <= 2.5) { + if (features[5] <= 0.5) { + if (features[13] <= 0.5) { + if (features[12] <= 4.5) { + classes[0] = 24; + classes[1] = 0; + } else { + if (features[0] <= 7.5) { + if (features[16] <= 1.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[12] <= 6.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 16; + classes[1] = 0; + } + } + } else { + classes[0] = 16; + classes[1] = 0; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[1] <= 168.0) { + if (features[2] <= 5.0) { + if (features[15] <= 1.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[16] <= 4.0) { + if (features[2] <= 10.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[6] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 8; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + if (features[17] <= 0.5) { + if (features[16] <= 3.5) { + if (features[12] <= 11.0) { + if (features[14] <= 1.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[12] <= 25.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[1] <= 230.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + classes[0] = 45; + classes[1] = 0; + } + } else { + if (features[16] <= 0.5) { + classes[0] = 51; + classes[1] = 0; + } else { + if (features[16] <= 5.5) { + if (features[14] <= 1.5) { + if (features[13] <= 0.5) { + if (features[1] <= 42.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[15] <= 0.5) { + if (features[7] <= 44.5) { + classes[0] = 0; + classes[1] = 10; + } else { + if (features[5] <= 2.5) { + if (features[11] <= 0.5) { + if (features[7] <= 70.0) { + if (features[2] <= 26.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 26; + } + } + } else { + if (features[9] <= 34.0) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + if (features[9] <= 29.5) { + if (features[17] <= 0.5) { + if (features[1] <= 70.0) { + if (features[14] <= 9.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[12] <= 66.0) { + classes[0] = 14; + classes[1] = 0; + } else { + if (features[1] <= 1038.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[7] <= 77.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[14] <= 38.5) { + if (features[15] <= 11.5) { + classes[0] = 0; + classes[1] = 15; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 22; + } + } + } + } + } else { + if (features[15] <= 5.5) { + if (features[9] <= 18.5) { + if (features[0] <= 8.5) { + if (features[7] <= 141.0) { + if (features[0] <= 4.5) { + if (features[16] <= 2.5) { + if (features[1] <= 16.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[2] <= 9.0) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[7] <= 45.5) { + if (features[2] <= 16.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 11; + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[5] <= 0.5) { + if (features[9] <= 6.5) { + classes[0] = 13; + classes[1] = 0; + } else { + if (features[2] <= 9.0) { + classes[0] = 14; + classes[1] = 0; + } else { + if (features[8] <= 0.5) { + if (features[14] <= 2.5) { + if (features[12] <= 11.0) { + if (features[16] <= 4.0) { + if (features[7] <= 65.0) { + if (features[4] <= 56.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[16] <= 5.0) { + if (features[4] <= 81.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[4] <= 92.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[15] <= 0.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[2] <= 22.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 12; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[14] <= 3.5) { + if (features[12] <= 31.5) { + if (features[14] <= 0.5) { + if (features[0] <= 17.5) { + if (features[12] <= 4.5) { + if (features[7] <= 9.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[16] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[1] <= 76.0) { + if (features[1] <= 69.5) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 16; + } + } + } + } else { + if (features[5] <= 1.0) { + if (features[3] <= 6.5) { + if (features[1] <= 113.5) { + if (features[9] <= 38.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } else { + if (features[2] <= 9.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[5] <= 12.0) { + if (features[6] <= 2.0) { + if (features[16] <= 5.5) { + if (features[4] <= 94.0) { + if (features[16] <= 3.5) { + classes[0] = 0; + classes[1] = 7; + } else { + if (features[15] <= 4.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[4] <= 500.5) { + classes[0] = 0; + classes[1] = 41; + } else { + if (features[0] <= 7.5) { + if (features[9] <= 29.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 12; + } + } + } + } else { + if (features[12] <= 5.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[2] <= 23.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[8] <= 0.5) { + if (features[7] <= 276.5) { + if (features[15] <= 3.0) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } else { + if (features[8] <= 1.5) { + if (features[1] <= 356.0) { + if (features[12] <= 46.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } + } else { + if (features[0] <= 9.0) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[16] <= 3.0) { + classes[0] = 14; + classes[1] = 0; + } else { + if (features[1] <= 341.5) { + if (features[3] <= 2.5) { + classes[0] = 8; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[9] <= 105.5) { + if (features[3] <= 4.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } + } + } else { + if (features[2] <= 22.5) { + if (features[4] <= 334.5) { + if (features[5] <= 0.5) { + if (features[2] <= 9.5) { + if (features[9] <= 45.5) { + if (features[9] <= 17.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 14; + classes[1] = 0; + } + } else { + classes[0] = 40; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[2] <= 19.5) { + if (features[1] <= 365.0) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[1] <= 228.5) { + if (features[9] <= 7.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 10; + } + } else { + if (features[4] <= 1191.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[0] <= 17.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } + } + } else { + if (features[7] <= 244.5) { + if (features[15] <= 20.5) { + if (features[15] <= 13.5) { + if (features[17] <= 0.5) { + if (features[14] <= 0.5) { + if (features[6] <= 1.5) { + if (features[7] <= 92.5) { + if (features[13] <= 0.5) { + if (features[1] <= 171.0) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 34; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[9] <= 5.5) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[14] <= 14.5) { + if (features[6] <= 0.5) { + if (features[9] <= 60.5) { + if (features[16] <= 0.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[15] <= 5.0) { + classes[0] = 0; + classes[1] = 33; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[8] <= 1.0) { + if (features[12] <= 17.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[9] <= 83.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + if (features[1] <= 18.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[16] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 136; + } + } + } + } else { + if (features[13] <= 0.5) { + classes[0] = 0; + classes[1] = 31; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 11; + classes[1] = 0; + } + } else { + if (features[17] <= 0.5) { + if (features[16] <= 1.5) { + classes[0] = 94; + classes[1] = 0; + } else { + if (features[1] <= 144.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[0] <= 61.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[15] <= 3.0) { + if (features[16] <= 4.5) { + if (features[2] <= 39.5) { + if (features[15] <= 1.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 0; + classes[1] = 13; + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_38(float features[]) { + int classes[2]; + + if (features[9] <= 8.5) { + if (features[16] <= 1.5) { + if (features[16] <= 0.5) { + classes[0] = 499; + classes[1] = 0; + } else { + if (features[2] <= 7.5) { + if (features[7] <= 7.5) { + if (features[12] <= 2.0) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } else { + classes[0] = 78; + classes[1] = 0; + } + } + } else { + if (features[0] <= 51.5) { + if (features[2] <= 80.5) { + if (features[1] <= 79.5) { + if (features[9] <= 6.5) { + if (features[3] <= 2.5) { + if (features[0] <= 18.0) { + if (features[2] <= 24.0) { + if (features[13] <= 0.5) { + if (features[1] <= 0.5) { + if (features[2] <= 3.0) { + if (features[18] <= 0.5) { + classes[0] = 8; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + if (features[9] <= 2.5) { + classes[0] = 23; + classes[1] = 0; + } else { + if (features[6] <= 0.5) { + if (features[16] <= 2.5) { + if (features[12] <= 7.0) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + classes[0] = 13; + classes[1] = 0; + } + } else { + if (features[2] <= 33.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } else { + if (features[12] <= 4.5) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[1] <= 54.0) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[1] <= 61.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } else { + if (features[15] <= 9.5) { + if (features[9] <= 4.5) { + classes[0] = 34; + classes[1] = 0; + } else { + if (features[12] <= 77.0) { + if (features[4] <= 87.0) { + classes[0] = 23; + classes[1] = 0; + } else { + if (features[4] <= 128.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[16] <= 3.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[15] <= 5.5) { + if (features[7] <= 160.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[13] <= 3.0) { + if (features[7] <= 144.0) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[12] <= 13.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[14] <= 3.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 0; + classes[1] = 12; + } + } + } + } else { + if (features[1] <= 178.5) { + if (features[16] <= 1.5) { + if (features[17] <= 0.5) { + if (features[16] <= 0.5) { + classes[0] = 221; + classes[1] = 0; + } else { + if (features[7] <= 201.0) { + if (features[4] <= 330.0) { + if (features[13] <= 1.5) { + if (features[4] <= 71.5) { + classes[0] = 43; + classes[1] = 0; + } else { + if (features[2] <= 35.5) { + classes[0] = 11; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[0] <= 23.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[12] <= 10.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[8] <= 2.5) { + if (features[0] <= 28.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + if (features[14] <= 3.5) { + classes[0] = 0; + classes[1] = 28; + } else { + if (features[8] <= 3.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + if (features[5] <= 13.0) { + if (features[17] <= 0.5) { + if (features[9] <= 16.5) { + if (features[0] <= 16.5) { + if (features[6] <= 0.5) { + if (features[7] <= 226.0) { + if (features[3] <= 0.5) { + if (features[1] <= 37.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[16] <= 3.5) { + if (features[12] <= 9.5) { + if (features[12] <= 4.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[14] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } else { + if (features[12] <= 20.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[9] <= 10.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 0; + classes[1] = 17; + } + } + } else { + if (features[11] <= 0.5) { + if (features[1] <= 23.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[12] <= 6.5) { + if (features[15] <= 1.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 16; + } + } + } else { + if (features[12] <= 5.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 11; + classes[1] = 0; + } + } else { + if (features[4] <= 36.5) { + if (features[12] <= 7.5) { + if (features[18] <= 0.5) { + if (features[1] <= 58.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 20; + classes[1] = 0; + } + } else { + if (features[4] <= 462.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[12] <= 2.5) { + if (features[9] <= 27.5) { + if (features[16] <= 4.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[3] <= 2.5) { + if (features[4] <= 86.5) { + if (features[0] <= 18.5) { + if (features[9] <= 50.5) { + if (features[12] <= 19.5) { + if (features[13] <= 1.5) { + if (features[0] <= 15.5) { + if (features[7] <= 21.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[2] <= 18.5) { + if (features[3] <= 0.5) { + if (features[16] <= 2.5) { + classes[0] = 0; + classes[1] = 9; + } else { + if (features[0] <= 10.5) { + if (features[5] <= 0.5) { + classes[0] = 0; + classes[1] = 9; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } else { + classes[0] = 0; + classes[1] = 42; + } + } + } else { + if (features[7] <= 107.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 36; + } + } else { + if (features[2] <= 25.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[15] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[7] <= 474.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + if (features[2] <= 22.5) { + if (features[14] <= 2.5) { + if (features[14] <= 0.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[6] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[12] <= 21.5) { + if (features[12] <= 12.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[8] <= 0.5) { + classes[0] = 0; + classes[1] = 17; + } else { + if (features[1] <= 158.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + if (features[13] <= 0.5) { + if (features[7] <= 179.0) { + if (features[15] <= 8.0) { + if (features[14] <= 0.5) { + classes[0] = 0; + classes[1] = 11; + } else { + if (features[7] <= 98.0) { + if (features[15] <= 3.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + if (features[7] <= 296.5) { + if (features[1] <= 103.0) { + if (features[3] <= 9.5) { + if (features[16] <= 2.5) { + if (features[7] <= 38.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 11; + } + } else { + if (features[1] <= 96.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 41; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[18] <= 0.5) { + if (features[16] <= 3.5) { + if (features[12] <= 8.5) { + classes[0] = 0; + classes[1] = 11; + } else { + if (features[11] <= 0.5) { + if (features[12] <= 14.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 18; + } + } else { + classes[0] = 0; + classes[1] = 120; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + if (features[14] <= 0.5) { + if (features[1] <= 256.5) { + if (features[0] <= 4.5) { + if (features[7] <= 943.5) { + if (features[16] <= 1.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[1] <= 216.0) { + classes[0] = 0; + classes[1] = 8; + } else { + if (features[7] <= 261.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[4] <= 126.0) { + if (features[17] <= 0.5) { + if (features[7] <= 114.5) { + if (features[7] <= 101.5) { + if (features[18] <= 0.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[5] <= 3.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 68; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[13] <= 0.5) { + if (features[16] <= 1.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[7] <= 388.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[0] <= 15.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 3.5) { + if (features[4] <= 118.5) { + classes[0] = 165; + classes[1] = 0; + } else { + if (features[4] <= 133.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[8] <= 0.5) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[3] <= 4.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } + } + } else { + if (features[2] <= 29.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } else { + if (features[16] <= 2.5) { + if (features[4] <= 1004.5) { + if (features[9] <= 20.5) { + classes[0] = 33; + classes[1] = 0; + } else { + if (features[7] <= 199.5) { + if (features[12] <= 71.5) { + if (features[12] <= 22.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[1] <= 301.5) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[7] <= 147.0) { + classes[0] = 17; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[17] <= 0.5) { + classes[0] = 37; + classes[1] = 0; + } else { + if (features[9] <= 27.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[14] <= 6.0) { + if (features[12] <= 50.5) { + if (features[2] <= 44.5) { + if (features[7] <= 49.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[7] <= 414.0) { + if (features[4] <= 154.0) { + classes[0] = 0; + classes[1] = 29; + } else { + if (features[3] <= 2.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 13; + } + } + } else { + if (features[14] <= 2.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[14] <= 4.5) { + if (features[1] <= 215.5) { + classes[0] = 11; + classes[1] = 0; + } else { + if (features[0] <= 16.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[13] <= 1.5) { + if (features[2] <= 58.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[18] <= 0.5) { + if (features[2] <= 55.5) { + classes[0] = 8; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 25; + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_39(float features[]) { + int classes[2]; + + if (features[17] <= 0.5) { + if (features[13] <= 1.5) { + if (features[5] <= 0.5) { + if (features[16] <= 1.5) { + if (features[9] <= 22.5) { + if (features[0] <= 12.5) { + if (features[16] <= 0.5) { + classes[0] = 304; + classes[1] = 0; + } else { + if (features[1] <= 402.0) { + if (features[2] <= 42.0) { + if (features[9] <= 0.5) { + if (features[12] <= 2.0) { + classes[0] = 37; + classes[1] = 0; + } else { + if (features[2] <= 5.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[0] <= 2.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[0] <= 4.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 48; + classes[1] = 0; + } + } else { + if (features[9] <= 9.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 348; + classes[1] = 0; + } + } else { + if (features[2] <= 39.5) { + if (features[16] <= 0.5) { + classes[0] = 205; + classes[1] = 0; + } else { + if (features[8] <= 0.5) { + if (features[0] <= 9.5) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[2] <= 11.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[1] <= 100.0) { + if (features[12] <= 5.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[7] <= 160.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[8] <= 10.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[1] <= 121.5) { + if (features[16] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[4] <= 91.0) { + if (features[0] <= 8.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 7; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 24; + classes[1] = 0; + } + } + } + } else { + if (features[9] <= 5.5) { + if (features[1] <= 39.5) { + classes[0] = 46; + classes[1] = 0; + } else { + if (features[15] <= 0.5) { + if (features[0] <= 23.5) { + if (features[4] <= 489.0) { + if (features[4] <= 208.5) { + if (features[0] <= 14.5) { + if (features[0] <= 5.5) { + if (features[1] <= 55.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[12] <= 4.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[7] <= 169.0) { + classes[0] = 12; + classes[1] = 0; + } else { + if (features[13] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 11; + classes[1] = 0; + } + } else { + if (features[2] <= 10.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[7] <= 363.0) { + classes[0] = 0; + classes[1] = 10; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 20; + classes[1] = 0; + } + } else { + if (features[2] <= 58.0) { + classes[0] = 19; + classes[1] = 0; + } else { + if (features[2] <= 120.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } + } else { + if (features[7] <= 189.0) { + if (features[16] <= 2.5) { + if (features[12] <= 4.5) { + if (features[4] <= 67.5) { + classes[0] = 21; + classes[1] = 0; + } else { + if (features[7] <= 24.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[13] <= 0.5) { + if (features[3] <= 3.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[14] <= 0.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[0] <= 7.5) { + if (features[12] <= 15.5) { + if (features[15] <= 3.0) { + if (features[11] <= 1.0) { + classes[0] = 0; + classes[1] = 12; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[3] <= 7.0) { + if (features[8] <= 1.5) { + if (features[8] <= 0.5) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 18; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[11] <= 2.5) { + if (features[15] <= 4.5) { + if (features[18] <= 0.5) { + if (features[14] <= 0.5) { + if (features[13] <= 0.5) { + if (features[1] <= 178.0) { + if (features[12] <= 17.0) { + if (features[9] <= 31.0) { + if (features[9] <= 17.0) { + if (features[0] <= 19.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[1] <= 94.0) { + classes[0] = 0; + classes[1] = 16; + } else { + if (features[12] <= 17.5) { + if (features[0] <= 24.0) { + if (features[9] <= 24.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[7] <= 41.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + classes[0] = 0; + classes[1] = 17; + } + } else { + if (features[4] <= 12.0) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + if (features[9] <= 8.5) { + if (features[15] <= 2.5) { + if (features[2] <= 8.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[0] <= 6.0) { + if (features[6] <= 1.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[0] <= 19.5) { + if (features[1] <= 46.0) { + if (features[11] <= 0.5) { + if (features[15] <= 0.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[14] <= 0.5) { + if (features[4] <= 42.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } else { + if (features[11] <= 1.5) { + if (features[14] <= 0.5) { + if (features[15] <= 8.5) { + if (features[6] <= 0.5) { + if (features[3] <= 0.5) { + if (features[7] <= 106.0) { + classes[0] = 0; + classes[1] = 14; + } else { + if (features[1] <= 116.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 23; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 75; + } + } else { + if (features[12] <= 15.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } + } else { + if (features[3] <= 0.5) { + if (features[2] <= 20.0) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[16] <= 4.5) { + if (features[15] <= 3.0) { + if (features[0] <= 25.0) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[0] <= 31.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[0] <= 23.5) { + if (features[1] <= 240.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } + } + } + } + } else { + if (features[12] <= 40.0) { + if (features[2] <= 15.5) { + if (features[2] <= 10.5) { + if (features[1] <= 193.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + if (features[15] <= 12.5) { + if (features[12] <= 14.0) { + if (features[16] <= 3.5) { + if (features[1] <= 106.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + if (features[3] <= 0.5) { + if (features[1] <= 247.0) { + if (features[15] <= 3.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 0; + classes[1] = 13; + } + } + } else { + if (features[14] <= 0.5) { + if (features[4] <= 502.5) { + if (features[13] <= 0.5) { + if (features[2] <= 23.0) { + if (features[9] <= 37.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[18] <= 0.5) { + if (features[16] <= 3.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[11] <= 0.5) { + if (features[0] <= 19.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[0] <= 72.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } + } else { + classes[0] = 27; + classes[1] = 0; + } + } + } + } + } else { + if (features[16] <= 1.5) { + classes[0] = 49; + classes[1] = 0; + } else { + if (features[12] <= 12.5) { + if (features[1] <= 63.5) { + if (features[14] <= 0.5) { + classes[0] = 8; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[6] <= 7.0) { + classes[0] = 0; + classes[1] = 13; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[15] <= 10.0) { + classes[0] = 0; + classes[1] = 20; + } else { + if (features[14] <= 16.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } + } else { + if (features[5] <= 1.5) { + if (features[2] <= 32.5) { + if (features[16] <= 5.5) { + if (features[2] <= 31.5) { + if (features[12] <= 10.5) { + if (features[12] <= 9.5) { + classes[0] = 31; + classes[1] = 0; + } else { + if (features[7] <= 126.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 64; + classes[1] = 0; + } + } else { + if (features[12] <= 41.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[15] <= 3.0) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + classes[0] = 57; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[9] <= 1.5) { + if (features[18] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[0] <= 4.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[12] <= 26.5) { + if (features[1] <= 207.5) { + if (features[12] <= 2.5) { + if (features[16] <= 1.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + if (features[7] <= 51.5) { + if (features[12] <= 5.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[0] <= 45.5) { + if (features[1] <= 80.5) { + if (features[1] <= 79.0) { + if (features[1] <= 55.0) { + classes[0] = 0; + classes[1] = 33; + } else { + if (features[1] <= 61.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 28; + } + } + } else { + if (features[2] <= 48.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 141; + } + } else { + if (features[15] <= 5.0) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } else { + if (features[16] <= 3.0) { + if (features[8] <= 0.5) { + if (features[7] <= 412.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[2] <= 47.0) { + if (features[16] <= 2.5) { + if (features[9] <= 12.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 36; + } + } else { + if (features[1] <= 206.5) { + if (features[9] <= 20.5) { + if (features[9] <= 17.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + if (features[16] <= 1.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[12] <= 62.5) { + classes[0] = 0; + classes[1] = 11; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_40(float features[]) { + int classes[2]; + + if (features[16] <= 1.5) { + if (features[3] <= 0.5) { + if (features[17] <= 0.5) { + if (features[7] <= 46.5) { + if (features[12] <= 3.5) { + classes[0] = 226; + classes[1] = 0; + } else { + if (features[7] <= 45.5) { + if (features[7] <= 6.5) { + if (features[9] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 63; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[15] <= 0.5) { + if (features[7] <= 287.5) { + classes[0] = 301; + classes[1] = 0; + } else { + if (features[1] <= 123.5) { + if (features[14] <= 0.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[12] <= 10.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 105; + classes[1] = 0; + } + } + } else { + classes[0] = 410; + classes[1] = 0; + } + } + } else { + if (features[14] <= 3.5) { + if (features[12] <= 19.0) { + if (features[9] <= 5.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 15; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + if (features[17] <= 0.5) { + if (features[7] <= 72.0) { + if (features[4] <= 90.0) { + if (features[12] <= 13.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[1] <= 83.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 11; + classes[1] = 0; + } + } else { + if (features[8] <= 3.0) { + classes[0] = 75; + classes[1] = 0; + } else { + if (features[0] <= 22.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } else { + if (features[18] <= 0.5) { + if (features[13] <= 0.5) { + if (features[16] <= 2.5) { + if (features[14] <= 0.5) { + if (features[9] <= 217.5) { + if (features[9] <= 11.5) { + if (features[3] <= 0.5) { + if (features[7] <= 102.5) { + classes[0] = 36; + classes[1] = 0; + } else { + if (features[8] <= 0.5) { + if (features[2] <= 19.5) { + if (features[9] <= 2.5) { + if (features[9] <= 1.5) { + if (features[2] <= 13.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[1] <= 296.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + if (features[8] <= 30.5) { + if (features[3] <= 0.5) { + if (features[9] <= 24.5) { + if (features[0] <= 10.0) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[1] <= 124.5) { + if (features[2] <= 9.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[11] <= 1.0) { + if (features[15] <= 0.5) { + if (features[9] <= 16.5) { + if (features[12] <= 9.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + if (features[9] <= 52.5) { + if (features[12] <= 32.0) { + if (features[15] <= 1.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[9] <= 31.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + if (features[3] <= 5.5) { + if (features[2] <= 11.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 11; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + if (features[14] <= 7.5) { + if (features[9] <= 7.5) { + if (features[2] <= 38.5) { + classes[0] = 15; + classes[1] = 0; + } else { + if (features[0] <= 7.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[2] <= 9.5) { + if (features[4] <= 411.0) { + if (features[1] <= 165.5) { + if (features[8] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 12; + classes[1] = 0; + } + } else { + if (features[12] <= 135.0) { + classes[0] = 0; + classes[1] = 9; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[7] <= 92.0) { + classes[0] = 0; + classes[1] = 40; + } else { + if (features[8] <= 0.5) { + if (features[4] <= 41.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[0] <= 15.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[14] <= 1.5) { + if (features[7] <= 223.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } + } + } else { + if (features[7] <= 111.0) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[1] <= 84.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } + } else { + if (features[2] <= 20.5) { + if (features[9] <= 13.5) { + if (features[9] <= 4.5) { + classes[0] = 46; + classes[1] = 0; + } else { + if (features[0] <= 1.5) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[2] <= 8.5) { + if (features[4] <= 123.5) { + if (features[2] <= 4.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[7] <= 19.0) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[7] <= 28.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 18; + classes[1] = 0; + } + } + } + } else { + if (features[15] <= 5.0) { + if (features[1] <= 369.0) { + if (features[9] <= 20.5) { + if (features[7] <= 132.0) { + if (features[6] <= 0.5) { + if (features[3] <= 0.5) { + if (features[0] <= 13.0) { + classes[0] = 0; + classes[1] = 11; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[2] <= 15.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 56; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[1] <= 64.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[4] <= 139.0) { + if (features[0] <= 4.0) { + if (features[15] <= 8.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[12] <= 27.5) { + if (features[15] <= 3.5) { + if (features[1] <= 129.5) { + if (features[0] <= 38.0) { + if (features[1] <= 59.0) { + if (features[16] <= 3.5) { + if (features[0] <= 13.0) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } else { + classes[0] = 0; + classes[1] = 56; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[16] <= 3.5) { + if (features[5] <= 0.5) { + if (features[1] <= 139.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[12] <= 15.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } else { + if (features[9] <= 37.5) { + if (features[15] <= 5.5) { + if (features[9] <= 5.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 0; + classes[1] = 11; + } + } else { + if (features[0] <= 21.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } + } else { + if (features[3] <= 2.5) { + if (features[8] <= 0.5) { + if (features[12] <= 29.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[2] <= 22.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[9] <= 26.5) { + if (features[3] <= 1.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + if (features[3] <= 7.0) { + if (features[4] <= 718.5) { + classes[0] = 0; + classes[1] = 9; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[2] <= 10.5) { + classes[0] = 24; + classes[1] = 0; + } else { + if (features[4] <= 14.0) { + if (features[9] <= 37.5) { + if (features[9] <= 25.5) { + if (features[1] <= 243.0) { + if (features[14] <= 0.5) { + classes[0] = 35; + classes[1] = 0; + } else { + if (features[0] <= 2.5) { + if (features[13] <= 1.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[16] <= 3.0) { + if (features[2] <= 29.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[14] <= 0.5) { + if (features[0] <= 3.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[8] <= 0.5) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + if (features[12] <= 30.5) { + classes[0] = 0; + classes[1] = 8; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 19; + classes[1] = 0; + } + } else { + if (features[16] <= 3.5) { + if (features[9] <= 6.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[4] <= 95.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[4] <= 104.5) { + if (features[4] <= 97.5) { + if (features[1] <= 274.5) { + if (features[1] <= 159.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 16; + } + } + } + } + } + } else { + if (features[14] <= 0.5) { + if (features[17] <= 0.5) { + if (features[9] <= 18.0) { + if (features[2] <= 4.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[9] <= 8.0) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[9] <= 11.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } else { + if (features[13] <= 0.5) { + classes[0] = 0; + classes[1] = 11; + } else { + if (features[9] <= 22.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[12] <= 20.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[7] <= 44.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 24; + } + } + } else { + if (features[1] <= 180.5) { + if (features[9] <= 2.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 108; + } + } else { + if (features[2] <= 46.5) { + classes[0] = 0; + classes[1] = 39; + } else { + if (features[7] <= 271.5) { + classes[0] = 0; + classes[1] = 17; + } else { + if (features[14] <= 2.5) { + classes[0] = 10; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_41(float features[]) { + int classes[2]; + + if (features[4] <= 18.5) { + if (features[17] <= 0.5) { + if (features[9] <= 14.5) { + if (features[14] <= 0.5) { + if (features[2] <= 38.5) { + if (features[2] <= 28.5) { + if (features[16] <= 1.5) { + if (features[2] <= 7.5) { + if (features[15] <= 0.5) { + if (features[7] <= 4.5) { + classes[0] = 104; + classes[1] = 0; + } else { + if (features[1] <= 34.5) { + classes[0] = 50; + classes[1] = 0; + } else { + if (features[9] <= 0.5) { + if (features[12] <= 5.0) { + if (features[7] <= 8.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 20; + classes[1] = 0; + } + } + } + } else { + classes[0] = 18; + classes[1] = 0; + } + } else { + classes[0] = 279; + classes[1] = 0; + } + } else { + if (features[1] <= 57.0) { + if (features[0] <= 17.5) { + if (features[18] <= 0.5) { + if (features[16] <= 2.5) { + if (features[12] <= 8.0) { + classes[0] = 35; + classes[1] = 0; + } else { + if (features[15] <= 1.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[6] <= 5.5) { + if (features[8] <= 0.5) { + if (features[1] <= 10.5) { + classes[0] = 16; + classes[1] = 0; + } else { + if (features[0] <= 2.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[9] <= 7.0) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[0] <= 5.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[16] <= 2.5) { + if (features[11] <= 3.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[11] <= 0.5) { + if (features[12] <= 77.0) { + classes[0] = 36; + classes[1] = 0; + } else { + if (features[2] <= 12.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 20; + classes[1] = 0; + } + } + } + } else { + classes[0] = 76; + classes[1] = 0; + } + } else { + if (features[2] <= 39.5) { + if (features[7] <= 345.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + if (features[16] <= 3.5) { + if (features[15] <= 0.5) { + if (features[9] <= 12.5) { + classes[0] = 35; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 37; + classes[1] = 0; + } + } else { + if (features[7] <= 218.5) { + if (features[1] <= 127.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[2] <= 55.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } + } else { + if (features[16] <= 1.5) { + if (features[14] <= 2.0) { + if (features[15] <= 0.5) { + if (features[13] <= 1.5) { + classes[0] = 16; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 18; + classes[1] = 0; + } + } else { + classes[0] = 81; + classes[1] = 0; + } + } else { + if (features[2] <= 50.5) { + if (features[14] <= 2.5) { + if (features[0] <= 26.5) { + if (features[1] <= 77.5) { + if (features[9] <= 7.0) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[2] <= 43.0) { + if (features[15] <= 2.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[16] <= 2.5) { + if (features[12] <= 7.5) { + if (features[0] <= 6.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 19; + classes[1] = 0; + } + } else { + if (features[1] <= 178.0) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[16] <= 1.5) { + if (features[7] <= 195.5) { + classes[0] = 201; + classes[1] = 0; + } else { + if (features[12] <= 10.5) { + if (features[0] <= 22.5) { + if (features[14] <= 0.5) { + if (features[1] <= 86.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 29; + classes[1] = 0; + } + } else { + classes[0] = 150; + classes[1] = 0; + } + } + } else { + if (features[0] <= 16.5) { + if (features[1] <= 176.5) { + if (features[5] <= 9.0) { + if (features[11] <= 1.5) { + if (features[0] <= 1.5) { + if (features[1] <= 60.0) { + if (features[0] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + if (features[12] <= 16.0) { + if (features[11] <= 0.5) { + if (features[2] <= 5.5) { + if (features[7] <= 48.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[13] <= 0.5) { + if (features[9] <= 15.5) { + if (features[12] <= 5.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[2] <= 14.5) { + if (features[14] <= 0.5) { + if (features[1] <= 116.5) { + classes[0] = 0; + classes[1] = 9; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 45; + } + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } + } else { + if (features[12] <= 4.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[2] <= 46.5) { + if (features[14] <= 0.5) { + if (features[12] <= 21.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[2] <= 30.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[1] <= 389.5) { + if (features[9] <= 28.5) { + if (features[12] <= 46.0) { + if (features[12] <= 36.0) { + if (features[0] <= 4.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + if (features[12] <= 22.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[16] <= 4.5) { + if (features[14] <= 0.5) { + if (features[2] <= 75.5) { + if (features[0] <= 36.0) { + if (features[0] <= 32.0) { + if (features[1] <= 263.0) { + if (features[1] <= 105.5) { + if (features[7] <= 159.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 14; + classes[1] = 0; + } + } else { + if (features[13] <= 0.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 19; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[15] <= 2.5) { + if (features[2] <= 50.5) { + if (features[1] <= 283.5) { + classes[0] = 0; + classes[1] = 11; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[16] <= 2.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[2] <= 41.5) { + if (features[15] <= 12.5) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[5] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } + } + } + } else { + if (features[0] <= 0.5) { + if (features[16] <= 3.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[9] <= 25.0) { + if (features[7] <= 292.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[9] <= 68.5) { + if (features[0] <= 30.5) { + if (features[15] <= 1.5) { + if (features[1] <= 82.0) { + if (features[2] <= 64.5) { + classes[0] = 0; + classes[1] = 19; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 78; + } + } else { + classes[0] = 0; + classes[1] = 52; + } + } else { + if (features[18] <= 0.5) { + if (features[9] <= 45.0) { + if (features[15] <= 7.0) { + if (features[1] <= 191.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[9] <= 4.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 31; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } else { + if (features[14] <= 0.5) { + if (features[0] <= 9.5) { + if (features[16] <= 2.5) { + if (features[0] <= 0.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[4] <= 278.0) { + if (features[8] <= 2.5) { + if (features[15] <= 0.5) { + classes[0] = 19; + classes[1] = 0; + } else { + if (features[0] <= 4.0) { + if (features[15] <= 2.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[5] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[3] <= 6.5) { + classes[0] = 0; + classes[1] = 7; + } else { + if (features[8] <= 11.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + if (features[6] <= 0.5) { + classes[0] = 0; + classes[1] = 30; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[16] <= 3.5) { + if (features[0] <= 22.5) { + if (features[3] <= 10.0) { + if (features[4] <= 68.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[11] <= 2.0) { + classes[0] = 16; + classes[1] = 0; + } else { + if (features[9] <= 21.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[11] <= 5.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 51; + classes[1] = 0; + } + } else { + if (features[2] <= 24.5) { + if (features[2] <= 19.0) { + if (features[9] <= 21.5) { + if (features[0] <= 36.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[7] <= 205.0) { + if (features[0] <= 68.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[9] <= 6.0) { + if (features[12] <= 19.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } + } + } + } else { + if (features[17] <= 0.5) { + if (features[1] <= 48.0) { + if (features[8] <= 0.5) { + if (features[12] <= 5.5) { + classes[0] = 27; + classes[1] = 0; + } else { + if (features[7] <= 123.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[7] <= 129.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[7] <= 121.0) { + if (features[15] <= 4.5) { + if (features[13] <= 0.5) { + classes[0] = 0; + classes[1] = 49; + } else { + if (features[9] <= 34.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[12] <= 16.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[7] <= 136.0) { + classes[0] = 12; + classes[1] = 0; + } else { + if (features[9] <= 34.5) { + if (features[4] <= 104.0) { + if (features[4] <= 80.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[1] <= 84.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 24; + classes[1] = 0; + } + } + } else { + if (features[16] <= 1.0) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[0] <= 58.5) { + if (features[2] <= 12.5) { + if (features[0] <= 8.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 11; + } + } else { + if (features[2] <= 30.0) { + if (features[2] <= 25.0) { + classes[0] = 0; + classes[1] = 8; + } else { + if (features[4] <= 522.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 71; + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_42(float features[]) { + int classes[2]; + + if (features[7] <= 21.5) { + if (features[3] <= 0.5) { + if (features[16] <= 5.5) { + classes[0] = 231; + classes[1] = 0; + } else { + if (features[15] <= 4.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + if (features[4] <= 118.0) { + if (features[9] <= 12.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + if (features[14] <= 0.5) { + if (features[0] <= 10.5) { + if (features[9] <= 14.5) { + if (features[17] <= 0.5) { + if (features[4] <= 213.5) { + if (features[7] <= 22.5) { + if (features[9] <= 8.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[16] <= 1.5) { + classes[0] = 188; + classes[1] = 0; + } else { + if (features[9] <= 13.5) { + if (features[7] <= 39.5) { + if (features[4] <= 122.0) { + if (features[3] <= 0.5) { + if (features[9] <= 2.5) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[1] <= 78.5) { + if (features[7] <= 29.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + if (features[7] <= 31.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[7] <= 68.0) { + if (features[2] <= 30.0) { + classes[0] = 13; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 36; + classes[1] = 0; + } + } + } else { + if (features[2] <= 28.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + if (features[1] <= 173.0) { + if (features[2] <= 15.5) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + if (features[12] <= 39.0) { + if (features[2] <= 15.5) { + if (features[16] <= 2.5) { + if (features[12] <= 0.5) { + if (features[4] <= 35.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[4] <= 12.0) { + classes[0] = 27; + classes[1] = 0; + } else { + if (features[9] <= 17.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } else { + if (features[10] <= 0.5) { + if (features[9] <= 34.0) { + classes[0] = 0; + classes[1] = 20; + } else { + if (features[15] <= 4.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[17] <= 0.5) { + if (features[7] <= 100.0) { + if (features[15] <= 3.0) { + if (features[16] <= 2.5) { + if (features[15] <= 1.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 41; + } + } else { + if (features[7] <= 60.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[3] <= 0.5) { + if (features[1] <= 93.5) { + if (features[12] <= 8.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[9] <= 182.5) { + classes[0] = 11; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } + } else { + classes[0] = 0; + classes[1] = 24; + } + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } else { + if (features[17] <= 0.5) { + if (features[5] <= 0.5) { + if (features[16] <= 2.5) { + if (features[16] <= 1.5) { + if (features[0] <= 15.5) { + if (features[16] <= 0.5) { + classes[0] = 61; + classes[1] = 0; + } else { + if (features[3] <= 0.5) { + if (features[9] <= 31.5) { + classes[0] = 17; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[2] <= 32.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 424; + classes[1] = 0; + } + } else { + if (features[3] <= 0.5) { + if (features[2] <= 17.5) { + classes[0] = 25; + classes[1] = 0; + } else { + if (features[0] <= 24.0) { + if (features[2] <= 21.0) { + if (features[7] <= 109.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 19; + classes[1] = 0; + } + } + } else { + if (features[7] <= 135.0) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[2] <= 15.0) { + if (features[2] <= 9.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } + } + } else { + if (features[12] <= 26.0) { + if (features[15] <= 3.5) { + if (features[0] <= 23.5) { + if (features[13] <= 1.5) { + if (features[11] <= 1.5) { + if (features[3] <= 0.5) { + if (features[7] <= 64.0) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[13] <= 0.5) { + if (features[2] <= 21.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } else { + if (features[3] <= 1.0) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } else { + classes[0] = 20; + classes[1] = 0; + } + } else { + if (features[2] <= 35.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + if (features[2] <= 30.5) { + classes[0] = 16; + classes[1] = 0; + } else { + if (features[13] <= 1.5) { + if (features[2] <= 31.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[9] <= 4.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } + } + } else { + if (features[13] <= 3.0) { + if (features[7] <= 270.0) { + classes[0] = 26; + classes[1] = 0; + } else { + if (features[16] <= 2.5) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } else { + if (features[12] <= 63.0) { + if (features[12] <= 6.5) { + classes[0] = 0; + classes[1] = 10; + } else { + if (features[2] <= 32.0) { + if (features[2] <= 17.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 16; + } + } else { + if (features[12] <= 26.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 1.5) { + if (features[14] <= 1.5) { + if (features[12] <= 10.5) { + if (features[0] <= 3.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[16] <= 0.5) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[4] <= 123.0) { + classes[0] = 0; + classes[1] = 11; + } else { + if (features[7] <= 72.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } + } else { + classes[0] = 29; + classes[1] = 0; + } + } else { + if (features[7] <= 52.5) { + if (features[13] <= 0.5) { + classes[0] = 19; + classes[1] = 0; + } else { + if (features[15] <= 11.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[1] <= 67.5) { + if (features[12] <= 3.5) { + if (features[1] <= 58.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 17; + classes[1] = 0; + } + } else { + classes[0] = 169; + classes[1] = 0; + } + } + } + } else { + if (features[18] <= 0.5) { + if (features[15] <= 5.5) { + if (features[1] <= 287.5) { + if (features[14] <= 7.5) { + if (features[9] <= 7.5) { + if (features[5] <= 0.5) { + if (features[0] <= 11.5) { + if (features[3] <= 0.5) { + classes[0] = 11; + classes[1] = 0; + } else { + if (features[16] <= 3.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[17] <= 0.5) { + if (features[0] <= 11.5) { + if (features[6] <= 0.5) { + if (features[16] <= 4.5) { + classes[0] = 0; + classes[1] = 28; + } else { + if (features[5] <= 0.5) { + classes[0] = 0; + classes[1] = 19; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[5] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[12] <= 4.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[2] <= 63.0) { + if (features[0] <= 13.5) { + if (features[2] <= 19.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[7] <= 47.0) { + if (features[12] <= 11.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[13] <= 0.5) { + if (features[9] <= 32.5) { + classes[0] = 0; + classes[1] = 24; + } else { + if (features[1] <= 97.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 15; + } + } + } else { + if (features[12] <= 17.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 24; + } + } + } else { + if (features[16] <= 4.5) { + if (features[1] <= 55.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[2] <= 31.0) { + if (features[7] <= 123.0) { + if (features[14] <= 9.0) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[13] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 11; + classes[1] = 0; + } + } else { + if (features[14] <= 22.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[9] <= 31.0) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[4] <= 413.5) { + if (features[7] <= 162.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[12] <= 42.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[1] <= 459.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[0] <= 66.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[17] <= 0.5) { + if (features[4] <= 455.0) { + if (features[4] <= 156.0) { + if (features[1] <= 620.0) { + if (features[12] <= 4.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[9] <= 15.0) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[2] <= 14.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[15] <= 27.0) { + if (features[15] <= 11.5) { + classes[0] = 0; + classes[1] = 10; + } else { + if (features[0] <= 21.5) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[15] <= 42.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[15] <= 13.0) { + classes[0] = 29; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[7] <= 141.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } else { + if (features[7] <= 228.0) { + classes[0] = 0; + classes[1] = 14; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[7] <= 310.5) { + if (features[0] <= 41.0) { + if (features[2] <= 72.5) { + if (features[7] <= 50.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[9] <= 12.5) { + if (features[8] <= 0.5) { + classes[0] = 0; + classes[1] = 18; + } else { + if (features[17] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 120; + } + } + } else { + if (features[9] <= 35.0) { + classes[0] = 0; + classes[1] = 8; + } else { + if (features[14] <= 10.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[9] <= 7.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 15; + } + } + } else { + if (features[15] <= 5.0) { + if (features[7] <= 365.0) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[1] <= 298.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 15; + } + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_43(float features[]) { + int classes[2]; + + if (features[17] <= 0.5) { + if (features[4] <= 62.5) { + if (features[14] <= 0.5) { + if (features[16] <= 2.5) { + if (features[0] <= 2.5) { + classes[0] = 244; + classes[1] = 0; + } else { + if (features[2] <= 79.0) { + if (features[16] <= 1.5) { + if (features[7] <= 195.5) { + if (features[1] <= 465.5) { + classes[0] = 392; + classes[1] = 0; + } else { + if (features[12] <= 15.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 14; + classes[1] = 0; + } + } + } else { + if (features[0] <= 15.5) { + if (features[16] <= 0.5) { + classes[0] = 38; + classes[1] = 0; + } else { + if (features[1] <= 112.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + classes[0] = 181; + classes[1] = 0; + } + } + } else { + if (features[6] <= 0.5) { + if (features[11] <= 2.5) { + if (features[11] <= 1.5) { + if (features[2] <= 11.0) { + if (features[12] <= 74.5) { + if (features[0] <= 4.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[0] <= 12.5) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[1] <= 133.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[12] <= 15.5) { + if (features[8] <= 0.5) { + if (features[12] <= 14.0) { + if (features[9] <= 3.5) { + if (features[2] <= 18.5) { + if (features[9] <= 2.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 16; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 28; + classes[1] = 0; + } + } + } else { + if (features[9] <= 76.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 14; + classes[1] = 0; + } + } else { + if (features[9] <= 15.0) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[9] <= 52.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[16] <= 1.5) { + classes[0] = 16; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + if (features[1] <= 13.0) { + classes[0] = 18; + classes[1] = 0; + } else { + if (features[16] <= 4.5) { + if (features[0] <= 16.5) { + if (features[7] <= 238.0) { + if (features[7] <= 58.5) { + if (features[1] <= 52.0) { + if (features[2] <= 7.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[1] <= 47.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[9] <= 40.0) { + if (features[0] <= 2.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 9; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[9] <= 14.0) { + if (features[3] <= 0.5) { + if (features[12] <= 4.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[0] <= 14.5) { + if (features[18] <= 0.5) { + if (features[12] <= 12.5) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[12] <= 14.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[12] <= 15.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[12] <= 27.5) { + if (features[2] <= 35.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 16; + } + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + if (features[9] <= 21.5) { + if (features[16] <= 3.5) { + classes[0] = 28; + classes[1] = 0; + } else { + if (features[1] <= 228.0) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[13] <= 0.5) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } else { + if (features[13] <= 3.0) { + classes[0] = 0; + classes[1] = 11; + } else { + if (features[0] <= 34.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } + } else { + if (features[0] <= 16.5) { + if (features[1] <= 39.0) { + if (features[7] <= 80.5) { + classes[0] = 15; + classes[1] = 0; + } else { + if (features[2] <= 24.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[16] <= 1.5) { + if (features[7] <= 89.5) { + if (features[2] <= 45.0) { + if (features[13] <= 1.5) { + classes[0] = 24; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 39; + classes[1] = 0; + } + } else { + if (features[18] <= 0.5) { + if (features[9] <= 10.0) { + if (features[7] <= 118.5) { + classes[0] = 18; + classes[1] = 0; + } else { + if (features[1] <= 95.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[15] <= 4.5) { + if (features[2] <= 57.5) { + if (features[11] <= 1.5) { + if (features[7] <= 143.5) { + if (features[16] <= 2.5) { + if (features[0] <= 12.5) { + classes[0] = 0; + classes[1] = 12; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[15] <= 3.0) { + classes[0] = 0; + classes[1] = 24; + } else { + if (features[9] <= 14.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[11] <= 1.5) { + if (features[1] <= 66.5) { + if (features[7] <= 88.0) { + if (features[9] <= 19.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[15] <= 6.5) { + if (features[9] <= 32.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[9] <= 46.0) { + classes[0] = 0; + classes[1] = 14; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[14] <= 4.5) { + if (features[7] <= 106.0) { + if (features[9] <= 7.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[16] <= 1.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[12] <= 5.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[12] <= 30.0) { + classes[0] = 0; + classes[1] = 13; + } else { + if (features[12] <= 35.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } + } else { + if (features[16] <= 1.5) { + classes[0] = 40; + classes[1] = 0; + } else { + if (features[1] <= 303.0) { + if (features[15] <= 1.5) { + classes[0] = 0; + classes[1] = 9; + } else { + if (features[1] <= 121.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } + } else { + if (features[15] <= 0.5) { + if (features[2] <= 16.5) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[14] <= 17.5) { + if (features[16] <= 1.0) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 11; + classes[1] = 0; + } + } + } else { + if (features[14] <= 7.5) { + if (features[15] <= 1.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[8] <= 0.5) { + classes[0] = 8; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 94; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[3] <= 2.5) { + if (features[8] <= 4.0) { + if (features[16] <= 1.5) { + if (features[9] <= 152.5) { + if (features[8] <= 1.5) { + if (features[4] <= 74.5) { + if (features[2] <= 33.0) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[2] <= 37.0) { + classes[0] = 58; + classes[1] = 0; + } else { + if (features[0] <= 15.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[4] <= 148.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + if (features[2] <= 13.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[16] <= 4.5) { + if (features[9] <= 6.5) { + if (features[5] <= 0.5) { + classes[0] = 19; + classes[1] = 0; + } else { + if (features[12] <= 20.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[13] <= 1.5) { + if (features[7] <= 185.0) { + if (features[1] <= 45.5) { + if (features[16] <= 3.5) { + if (features[2] <= 11.5) { + if (features[12] <= 4.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + if (features[6] <= 3.0) { + if (features[4] <= 214.5) { + if (features[13] <= 0.5) { + if (features[4] <= 90.5) { + if (features[12] <= 4.0) { + if (features[0] <= 6.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[0] <= 20.5) { + classes[0] = 0; + classes[1] = 12; + } else { + if (features[14] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + classes[0] = 0; + classes[1] = 18; + } + } else { + if (features[1] <= 112.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[11] <= 3.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[4] <= 102.5) { + if (features[13] <= 0.5) { + if (features[7] <= 260.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[5] <= 0.5) { + if (features[4] <= 182.0) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[15] <= 2.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[9] <= 33.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 13; + classes[1] = 0; + } + } + } else { + if (features[7] <= 302.0) { + classes[0] = 0; + classes[1] = 15; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[12] <= 45.0) { + if (features[9] <= 32.0) { + if (features[9] <= 16.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 14; + classes[1] = 0; + } + } + } else { + if (features[1] <= 173.0) { + if (features[0] <= 40.0) { + if (features[3] <= 5.5) { + if (features[4] <= 238.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[14] <= 0.5) { + if (features[9] <= 15.0) { + if (features[9] <= 13.0) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 14; + } + } else { + classes[0] = 0; + classes[1] = 17; + } + } + } else { + if (features[12] <= 4.5) { + if (features[12] <= 3.0) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[7] <= 162.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[16] <= 2.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 21; + } + } + } + } else { + if (features[2] <= 17.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[3] <= 10.0) { + if (features[8] <= 2.5) { + if (features[10] <= 0.5) { + if (features[16] <= 2.5) { + classes[0] = 18; + classes[1] = 0; + } else { + if (features[8] <= 0.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[4] <= 411.0) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[7] <= 136.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 9; + } + } + } + } else { + if (features[16] <= 1.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 11; + } + } + } + } + } + } else { + if (features[12] <= 69.5) { + if (features[16] <= 0.5) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[0] <= 0.5) { + if (features[2] <= 12.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + if (features[12] <= 9.5) { + if (features[1] <= 151.5) { + if (features[8] <= 0.5) { + if (features[1] <= 19.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[15] <= 9.0) { + classes[0] = 0; + classes[1] = 52; + } else { + if (features[14] <= 2.5) { + classes[0] = 0; + classes[1] = 15; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 25; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 148; + } + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_44(float features[]) { + int classes[2]; + + if (features[14] <= 0.5) { + if (features[17] <= 0.5) { + if (features[4] <= 18.5) { + if (features[11] <= 2.5) { + if (features[16] <= 3.5) { + if (features[11] <= 1.5) { + if (features[16] <= 1.5) { + if (features[1] <= 465.5) { + if (features[13] <= 0.5) { + if (features[0] <= 12.5) { + classes[0] = 358; + classes[1] = 0; + } else { + if (features[1] <= 74.5) { + if (features[1] <= 73.0) { + classes[0] = 50; + classes[1] = 0; + } else { + if (features[2] <= 24.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 220; + classes[1] = 0; + } + } + } else { + classes[0] = 124; + classes[1] = 0; + } + } else { + if (features[7] <= 67.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 51; + classes[1] = 0; + } + } + } else { + if (features[2] <= 25.5) { + if (features[7] <= 68.5) { + if (features[8] <= 0.5) { + classes[0] = 49; + classes[1] = 0; + } else { + if (features[1] <= 55.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[6] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[1] <= 55.5) { + if (features[9] <= 3.0) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[2] <= 12.5) { + if (features[2] <= 8.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + if (features[13] <= 0.5) { + if (features[12] <= 36.0) { + if (features[2] <= 15.5) { + if (features[0] <= 12.0) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[16] <= 2.5) { + if (features[1] <= 128.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 15; + classes[1] = 0; + } + } else { + if (features[9] <= 3.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[1] <= 197.0) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[2] <= 8.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + classes[0] = 20; + classes[1] = 0; + } + } + } + } else { + if (features[0] <= 9.0) { + if (features[13] <= 0.5) { + if (features[9] <= 4.0) { + if (features[0] <= 3.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[9] <= 21.0) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[13] <= 2.0) { + if (features[1] <= 158.5) { + if (features[1] <= 117.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[9] <= 18.0) { + classes[0] = 22; + classes[1] = 0; + } else { + if (features[16] <= 1.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[12] <= 3.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + if (features[9] <= 16.5) { + if (features[7] <= 406.0) { + if (features[11] <= 0.5) { + if (features[15] <= 1.5) { + classes[0] = 15; + classes[1] = 0; + } else { + if (features[1] <= 248.5) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[2] <= 33.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + if (features[2] <= 54.5) { + if (features[15] <= 6.0) { + classes[0] = 0; + classes[1] = 23; + } else { + if (features[16] <= 4.5) { + if (features[0] <= 9.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } else { + if (features[9] <= 27.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + classes[0] = 128; + classes[1] = 0; + } + } else { + if (features[16] <= 2.5) { + if (features[0] <= 28.0) { + if (features[3] <= 5.5) { + if (features[3] <= 4.5) { + if (features[16] <= 0.5) { + classes[0] = 26; + classes[1] = 0; + } else { + if (features[3] <= 1.5) { + if (features[12] <= 5.0) { + if (features[9] <= 96.0) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[1] <= 240.0) { + classes[0] = 0; + classes[1] = 8; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[1] <= 57.5) { + if (features[1] <= 33.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } else { + classes[0] = 44; + classes[1] = 0; + } + } else { + if (features[2] <= 27.5) { + if (features[9] <= 4.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[1] <= 143.0) { + classes[0] = 0; + classes[1] = 31; + } else { + if (features[3] <= 3.5) { + if (features[7] <= 225.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[7] <= 387.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } else { + if (features[15] <= 4.0) { + if (features[0] <= 49.5) { + if (features[16] <= 5.0) { + if (features[6] <= 3.0) { + if (features[4] <= 81.0) { + if (features[1] <= 97.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[1] <= 312.5) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[3] <= 3.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } + } else { + if (features[11] <= 0.5) { + if (features[7] <= 314.5) { + if (features[1] <= 21.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 52; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[17] <= 0.5) { + if (features[14] <= 2.5) { + if (features[15] <= 4.5) { + if (features[9] <= 7.5) { + if (features[12] <= 2.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 34; + classes[1] = 0; + } + } else { + if (features[15] <= 3.5) { + if (features[2] <= 54.5) { + if (features[5] <= 3.5) { + if (features[15] <= 1.5) { + if (features[15] <= 0.5) { + if (features[2] <= 8.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[1] <= 30.0) { + if (features[16] <= 1.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[7] <= 203.0) { + if (features[16] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[7] <= 80.5) { + if (features[7] <= 69.5) { + classes[0] = 0; + classes[1] = 16; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 26; + } + } + } else { + if (features[1] <= 174.5) { + if (features[7] <= 281.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[16] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } + } else { + if (features[1] <= 173.0) { + if (features[2] <= 31.5) { + classes[0] = 0; + classes[1] = 23; + } else { + if (features[0] <= 9.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[8] <= 0.5) { + if (features[4] <= 71.5) { + if (features[12] <= 5.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[16] <= 2.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } else { + if (features[16] <= 3.0) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[1] <= 91.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[4] <= 198.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + if (features[3] <= 0.5) { + if (features[7] <= 166.0) { + classes[0] = 0; + classes[1] = 20; + } else { + if (features[1] <= 893.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 11; + } + } + } + } else { + if (features[3] <= 4.0) { + if (features[12] <= 2.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[8] <= 5.5) { + if (features[13] <= 0.5) { + if (features[0] <= 1.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 48; + classes[1] = 0; + } + } else { + if (features[8] <= 0.5) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[1] <= 247.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[8] <= 6.5) { + if (features[9] <= 16.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 9; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[8] <= 3.5) { + if (features[7] <= 180.5) { + if (features[16] <= 3.5) { + if (features[3] <= 1.5) { + if (features[12] <= 17.5) { + if (features[7] <= 131.5) { + if (features[7] <= 35.5) { + if (features[16] <= 2.5) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 83; + classes[1] = 0; + } + } else { + if (features[12] <= 13.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[15] <= 9.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 1.5) { + classes[0] = 31; + classes[1] = 0; + } else { + if (features[15] <= 1.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } + } else { + if (features[12] <= 6.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[9] <= 6.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 26; + } + } + } else { + if (features[9] <= 62.0) { + if (features[0] <= 11.0) { + if (features[9] <= 10.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 73; + classes[1] = 0; + } + } else { + if (features[18] <= 0.5) { + classes[0] = 16; + classes[1] = 0; + } else { + if (features[14] <= 44.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[12] <= 42.0) { + if (features[9] <= 105.5) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + if (features[0] <= 71.0) { + if (features[3] <= 0.5) { + if (features[9] <= 8.5) { + if (features[7] <= 134.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[0] <= 0.5) { + if (features[7] <= 279.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[16] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[7] <= 75.0) { + if (features[15] <= 10.0) { + classes[0] = 0; + classes[1] = 13; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 107; + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 53; + } + } else { + if (features[8] <= 1.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_45(float features[]) { + int classes[2]; + + if (features[16] <= 1.5) { + if (features[17] <= 0.5) { + if (features[9] <= 22.5) { + if (features[16] <= 0.5) { + classes[0] = 705; + classes[1] = 0; + } else { + if (features[18] <= 0.5) { + if (features[2] <= 11.5) { + if (features[4] <= 99.0) { + if (features[2] <= 10.5) { + if (features[9] <= 0.5) { + if (features[12] <= 2.0) { + classes[0] = 15; + classes[1] = 0; + } else { + if (features[1] <= 52.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 26; + classes[1] = 0; + } + } else { + if (features[7] <= 49.5) { + if (features[0] <= 7.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 107; + classes[1] = 0; + } + } else { + if (features[14] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[8] <= 0.5) { + if (features[12] <= 0.5) { + if (features[1] <= 70.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[12] <= 10.5) { + if (features[4] <= 162.0) { + if (features[9] <= 49.5) { + classes[0] = 37; + classes[1] = 0; + } else { + if (features[9] <= 54.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 27; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[4] <= 84.5) { + classes[0] = 172; + classes[1] = 0; + } else { + if (features[16] <= 0.5) { + classes[0] = 13; + classes[1] = 0; + } else { + if (features[4] <= 101.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[7] <= 80.5) { + if (features[15] <= 5.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[12] <= 8.0) { + if (features[9] <= 38.0) { + if (features[1] <= 92.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 37; + classes[1] = 0; + } + } + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 8; + classes[1] = 0; + } else { + if (features[9] <= 5.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 31; + } + } + } + } else { + if (features[9] <= 7.5) { + if (features[2] <= 17.5) { + if (features[3] <= 2.5) { + if (features[16] <= 5.5) { + if (features[2] <= 9.5) { + if (features[16] <= 2.5) { + if (features[9] <= 2.5) { + classes[0] = 21; + classes[1] = 0; + } else { + if (features[1] <= 261.0) { + if (features[1] <= 57.0) { + if (features[9] <= 4.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 23; + classes[1] = 0; + } + } else { + classes[0] = 52; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[7] <= 400.5) { + if (features[1] <= 204.0) { + if (features[7] <= 69.5) { + if (features[2] <= 19.5) { + if (features[16] <= 2.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 19; + classes[1] = 0; + } + } else { + if (features[14] <= 0.5) { + if (features[2] <= 20.5) { + if (features[15] <= 0.5) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[15] <= 6.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[0] <= 1.5) { + if (features[18] <= 0.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[4] <= 177.0) { + classes[0] = 18; + classes[1] = 0; + } else { + if (features[2] <= 46.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + if (features[9] <= 3.5) { + if (features[0] <= 24.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } else { + classes[0] = 17; + classes[1] = 0; + } + } else { + if (features[9] <= 2.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } + } else { + if (features[16] <= 2.5) { + if (features[17] <= 0.5) { + if (features[12] <= 28.5) { + if (features[9] <= 12.5) { + if (features[9] <= 8.5) { + if (features[3] <= 1.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[8] <= 3.5) { + if (features[1] <= 40.5) { + if (features[9] <= 11.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 15; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[7] <= 26.5) { + if (features[12] <= 18.0) { + classes[0] = 15; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[0] <= 18.5) { + if (features[0] <= 1.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[12] <= 1.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[9] <= 15.5) { + if (features[7] <= 61.5) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[14] <= 0.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[2] <= 33.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[1] <= 37.5) { + if (features[0] <= 4.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[2] <= 21.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[14] <= 7.5) { + if (features[12] <= 6.5) { + classes[0] = 0; + classes[1] = 18; + } else { + if (features[14] <= 4.0) { + if (features[0] <= 14.0) { + if (features[9] <= 22.0) { + if (features[1] <= 84.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 0; + classes[1] = 13; + } + } else { + if (features[9] <= 19.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[7] <= 45.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[1] <= 166.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } + } + } else { + if (features[5] <= 0.5) { + if (features[14] <= 0.5) { + classes[0] = 19; + classes[1] = 0; + } else { + if (features[14] <= 5.5) { + if (features[4] <= 426.5) { + if (features[9] <= 119.0) { + if (features[15] <= 4.0) { + classes[0] = 0; + classes[1] = 8; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[7] <= 110.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + if (features[0] <= 8.5) { + classes[0] = 24; + classes[1] = 0; + } else { + if (features[8] <= 2.5) { + if (features[9] <= 15.5) { + if (features[3] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[13] <= 0.5) { + if (features[2] <= 8.0) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[9] <= 55.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[0] <= 32.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 11; + classes[1] = 0; + } + } + } else { + if (features[2] <= 39.5) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[6] <= 0.5) { + if (features[2] <= 48.5) { + classes[0] = 0; + classes[1] = 34; + } else { + if (features[12] <= 28.0) { + classes[0] = 0; + classes[1] = 22; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + if (features[0] <= 18.5) { + if (features[2] <= 60.0) { + if (features[5] <= 12.5) { + if (features[0] <= 0.5) { + if (features[7] <= 279.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[6] <= 5.5) { + if (features[12] <= 44.0) { + if (features[7] <= 189.0) { + if (features[14] <= 0.5) { + if (features[12] <= 12.5) { + if (features[9] <= 13.5) { + if (features[17] <= 0.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[13] <= 2.5) { + if (features[11] <= 1.5) { + classes[0] = 0; + classes[1] = 44; + } else { + if (features[11] <= 6.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 43; + } + } else { + if (features[6] <= 0.5) { + if (features[1] <= 58.5) { + if (features[14] <= 2.5) { + classes[0] = 0; + classes[1] = 18; + } else { + if (features[16] <= 3.5) { + if (features[1] <= 55.0) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 139; + } + } else { + if (features[8] <= 1.0) { + classes[0] = 0; + classes[1] = 17; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[12] <= 27.5) { + if (features[5] <= 0.5) { + if (features[8] <= 0.5) { + if (features[7] <= 197.0) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[9] <= 17.0) { + if (features[1] <= 252.5) { + classes[0] = 0; + classes[1] = 8; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 17; + } + } + } else { + if (features[2] <= 20.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[16] <= 5.0) { + if (features[0] <= 13.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + if (features[18] <= 0.5) { + if (features[1] <= 386.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[2] <= 69.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[1] <= 270.5) { + if (features[7] <= 136.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } else { + if (features[18] <= 0.5) { + if (features[5] <= 0.5) { + if (features[4] <= 146.0) { + if (features[8] <= 2.0) { + if (features[2] <= 30.0) { + classes[0] = 19; + classes[1] = 0; + } else { + if (features[15] <= 8.0) { + if (features[8] <= 0.5) { + if (features[0] <= 33.5) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[11] <= 30.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[9] <= 87.0) { + if (features[1] <= 266.5) { + if (features[7] <= 401.0) { + classes[0] = 0; + classes[1] = 14; + } else { + if (features[17] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[3] <= 5.0) { + if (features[16] <= 3.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } else { + if (features[1] <= 430.5) { + classes[0] = 0; + classes[1] = 53; + } else { + if (features[7] <= 1378.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_46(float features[]) { + int classes[2]; + + if (features[16] <= 1.5) { + if (features[16] <= 0.5) { + classes[0] = 1027; + classes[1] = 0; + } else { + if (features[1] <= 53.5) { + if (features[9] <= 44.0) { + if (features[2] <= 37.5) { + if (features[2] <= 5.5) { + if (features[1] <= 18.0) { + if (features[8] <= 1.0) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 14; + classes[1] = 0; + } + } else { + classes[0] = 86; + classes[1] = 0; + } + } else { + if (features[9] <= 19.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[7] <= 81.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[14] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[0] <= 11.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } else { + if (features[18] <= 0.5) { + if (features[14] <= 0.5) { + if (features[1] <= 56.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[7] <= 193.5) { + classes[0] = 33; + classes[1] = 0; + } else { + if (features[4] <= 46.5) { + if (features[2] <= 12.5) { + if (features[7] <= 400.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } + } else { + if (features[1] <= 155.0) { + if (features[17] <= 0.5) { + if (features[9] <= 9.0) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[0] <= 12.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[1] <= 102.5) { + if (features[2] <= 13.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + classes[0] = 0; + classes[1] = 8; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + if (features[12] <= 4.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[13] <= 0.5) { + if (features[7] <= 1146.5) { + classes[0] = 0; + classes[1] = 30; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[17] <= 0.5) { + if (features[3] <= 1.5) { + if (features[9] <= 12.5) { + if (features[9] <= 6.5) { + if (features[12] <= 28.5) { + if (features[16] <= 5.5) { + if (features[14] <= 0.5) { + if (features[9] <= 0.5) { + classes[0] = 38; + classes[1] = 0; + } else { + if (features[1] <= 55.5) { + if (features[7] <= 115.5) { + if (features[2] <= 3.0) { + if (features[9] <= 2.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[2] <= 26.5) { + classes[0] = 19; + classes[1] = 0; + } else { + if (features[2] <= 29.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 46; + classes[1] = 0; + } + } + } else { + if (features[0] <= 3.5) { + classes[0] = 15; + classes[1] = 0; + } else { + if (features[1] <= 89.5) { + if (features[11] <= 2.0) { + if (features[15] <= 6.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[2] <= 35.5) { + if (features[12] <= 77.0) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[9] <= 3.5) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[0] <= 16.0) { + if (features[15] <= 0.5) { + if (features[16] <= 3.5) { + classes[0] = 13; + classes[1] = 0; + } else { + if (features[18] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[1] <= 41.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[9] <= 10.5) { + classes[0] = 0; + classes[1] = 13; + } else { + if (features[9] <= 11.5) { + if (features[1] <= 110.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[12] <= 20.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[18] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[7] <= 102.5) { + if (features[12] <= 12.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } + } + } else { + if (features[0] <= 35.5) { + classes[0] = 19; + classes[1] = 0; + } else { + if (features[7] <= 168.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[7] <= 1390.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[0] <= 59.0) { + if (features[7] <= 125.5) { + if (features[1] <= 19.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[9] <= 80.0) { + if (features[16] <= 3.5) { + if (features[0] <= 10.5) { + if (features[14] <= 9.0) { + if (features[1] <= 178.0) { + if (features[0] <= 2.5) { + if (features[12] <= 5.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[13] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[13] <= 3.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[13] <= 0.5) { + if (features[9] <= 13.5) { + if (features[7] <= 56.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[11] <= 0.5) { + classes[0] = 0; + classes[1] = 31; + } else { + if (features[7] <= 97.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[6] <= 0.5) { + if (features[7] <= 37.5) { + classes[0] = 9; + classes[1] = 0; + } else { + if (features[14] <= 7.0) { + if (features[14] <= 0.5) { + if (features[1] <= 158.5) { + if (features[2] <= 15.5) { + if (features[3] <= 0.5) { + if (features[2] <= 11.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[12] <= 4.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[7] <= 45.5) { + if (features[3] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[2] <= 65.5) { + classes[0] = 0; + classes[1] = 23; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } else { + if (features[6] <= 1.0) { + if (features[9] <= 36.5) { + classes[0] = 0; + classes[1] = 62; + } else { + if (features[8] <= 0.5) { + if (features[14] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[15] <= 13.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[1] <= 192.0) { + if (features[1] <= 162.5) { + if (features[13] <= 0.5) { + if (features[2] <= 20.0) { + if (features[0] <= 1.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[14] <= 3.5) { + if (features[15] <= 15.5) { + if (features[9] <= 48.0) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[12] <= 40.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[7] <= 227.5) { + classes[0] = 0; + classes[1] = 10; + } else { + if (features[9] <= 18.0) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 11; + } + } + } + } else { + if (features[9] <= 23.5) { + if (features[13] <= 1.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 12; + classes[1] = 0; + } + } + } else { + if (features[0] <= 16.5) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[18] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[12] <= 11.0) { + if (features[12] <= 7.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[7] <= 280.0) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[2] <= 18.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[14] <= 4.5) { + if (features[2] <= 68.5) { + classes[0] = 32; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[16] <= 4.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[16] <= 3.5) { + classes[0] = 15; + classes[1] = 0; + } else { + if (features[0] <= 93.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } else { + if (features[0] <= 72.5) { + if (features[1] <= 273.0) { + if (features[12] <= 4.5) { + if (features[12] <= 1.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[7] <= 40.0) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[0] <= 2.0) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[7] <= 141.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[13] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[5] <= 12.5) { + if (features[2] <= 6.5) { + if (features[9] <= 25.0) { + if (features[14] <= 0.5) { + if (features[4] <= 213.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[12] <= 41.0) { + if (features[12] <= 11.5) { + if (features[1] <= 110.0) { + if (features[4] <= 333.5) { + classes[0] = 0; + classes[1] = 17; + } else { + if (features[12] <= 7.5) { + if (features[16] <= 3.5) { + if (features[9] <= 22.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[15] <= 4.5) { + classes[0] = 0; + classes[1] = 47; + } else { + if (features[16] <= 5.5) { + classes[0] = 0; + classes[1] = 14; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[0] <= 9.0) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[4] <= 718.5) { + if (features[14] <= 2.5) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[3] <= 4.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[14] <= 0.5) { + classes[0] = 8; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } + } else { + if (features[9] <= 1.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[4] <= 39.0) { + if (features[15] <= 0.5) { + classes[0] = 0; + classes[1] = 28; + } else { + if (features[7] <= 251.0) { + if (features[16] <= 3.5) { + if (features[2] <= 73.0) { + if (features[9] <= 51.5) { + if (features[7] <= 75.0) { + if (features[8] <= 0.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 51; + } + } else { + if (features[9] <= 73.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[0] <= 13.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 0; + classes[1] = 60; + } + } else { + if (features[7] <= 260.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[12] <= 30.5) { + if (features[16] <= 4.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } + } + } else { + classes[0] = 0; + classes[1] = 60; + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_47(float features[]) { + int classes[2]; + + if (features[17] <= 0.5) { + if (features[3] <= 0.5) { + if (features[2] <= 16.5) { + if (features[12] <= 2.5) { + if (features[1] <= 0.5) { + if (features[16] <= 5.5) { + classes[0] = 117; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 178; + classes[1] = 0; + } + } else { + if (features[16] <= 2.5) { + if (features[8] <= 1.5) { + if (features[12] <= 11.5) { + if (features[2] <= 9.5) { + if (features[2] <= 1.5) { + if (features[16] <= 1.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[9] <= 0.5) { + if (features[11] <= 2.0) { + if (features[7] <= 16.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 11; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 59; + classes[1] = 0; + } + } + } else { + if (features[15] <= 0.5) { + if (features[12] <= 5.5) { + classes[0] = 14; + classes[1] = 0; + } else { + if (features[16] <= 0.5) { + classes[0] = 15; + classes[1] = 0; + } else { + if (features[7] <= 86.5) { + if (features[12] <= 6.5) { + if (features[2] <= 11.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[7] <= 53.5) { + if (features[7] <= 38.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } else { + if (features[11] <= 0.5) { + if (features[0] <= 59.0) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + classes[0] = 26; + classes[1] = 0; + } + } + } else { + if (features[7] <= 113.0) { + if (features[12] <= 18.5) { + if (features[16] <= 1.5) { + classes[0] = 20; + classes[1] = 0; + } else { + if (features[7] <= 108.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 41; + classes[1] = 0; + } + } else { + classes[0] = 131; + classes[1] = 0; + } + } + } else { + if (features[1] <= 108.0) { + if (features[7] <= 124.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[0] <= 23.5) { + classes[0] = 15; + classes[1] = 0; + } else { + if (features[12] <= 25.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + if (features[12] <= 26.0) { + if (features[15] <= 0.5) { + if (features[18] <= 0.5) { + if (features[7] <= 39.0) { + if (features[12] <= 11.0) { + if (features[7] <= 35.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 21; + classes[1] = 0; + } + } else { + if (features[14] <= 2.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[15] <= 13.5) { + if (features[1] <= 61.5) { + if (features[0] <= 16.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[16] <= 3.5) { + if (features[12] <= 10.5) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[15] <= 4.5) { + classes[0] = 0; + classes[1] = 11; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[0] <= 19.5) { + if (features[7] <= 141.0) { + if (features[14] <= 0.5) { + if (features[7] <= 36.0) { + classes[0] = 40; + classes[1] = 0; + } else { + if (features[1] <= 64.0) { + if (features[1] <= 42.5) { + if (features[12] <= 3.5) { + if (features[12] <= 2.5) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[16] <= 3.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 13; + classes[1] = 0; + } + } else { + if (features[2] <= 29.5) { + if (features[16] <= 1.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 20; + } + } else { + if (features[9] <= 4.0) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[1] <= 55.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } + } else { + if (features[1] <= 161.0) { + if (features[16] <= 3.5) { + classes[0] = 36; + classes[1] = 0; + } else { + if (features[7] <= 94.0) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[2] <= 32.0) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[15] <= 2.5) { + if (features[0] <= 5.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[16] <= 1.5) { + classes[0] = 24; + classes[1] = 0; + } else { + if (features[12] <= 44.0) { + if (features[9] <= 7.5) { + if (features[12] <= 8.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + if (features[0] <= 11.5) { + classes[0] = 0; + classes[1] = 33; + } else { + if (features[15] <= 2.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[13] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + if (features[13] <= 1.5) { + if (features[1] <= 127.0) { + if (features[11] <= 1.5) { + if (features[9] <= 18.0) { + if (features[15] <= 14.0) { + if (features[0] <= 10.5) { + classes[0] = 16; + classes[1] = 0; + } else { + if (features[0] <= 12.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[16] <= 2.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[12] <= 11.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[1] <= 101.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[16] <= 1.5) { + classes[0] = 58; + classes[1] = 0; + } else { + if (features[18] <= 0.5) { + if (features[11] <= 1.5) { + if (features[9] <= 108.0) { + if (features[1] <= 352.5) { + if (features[1] <= 211.0) { + if (features[2] <= 55.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[9] <= 15.0) { + if (features[9] <= 13.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + classes[0] = 20; + classes[1] = 0; + } + } + } else { + if (features[16] <= 1.5) { + classes[0] = 338; + classes[1] = 0; + } else { + if (features[5] <= 0.5) { + if (features[18] <= 0.5) { + if (features[2] <= 28.5) { + classes[0] = 29; + classes[1] = 0; + } else { + if (features[14] <= 0.5) { + if (features[16] <= 4.5) { + if (features[2] <= 32.5) { + if (features[7] <= 147.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 16; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[16] <= 2.5) { + if (features[0] <= 43.0) { + if (features[7] <= 180.5) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[9] <= 82.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[9] <= 13.5) { + if (features[16] <= 4.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } + } + } else { + if (features[16] <= 2.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[2] <= 56.0) { + if (features[2] <= 43.5) { + classes[0] = 0; + classes[1] = 6; + } else { + if (features[0] <= 28.5) { + if (features[16] <= 3.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[1] <= 124.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 12; + } + } + } + } + } else { + if (features[15] <= 5.5) { + if (features[0] <= 18.5) { + if (features[9] <= 15.5) { + if (features[12] <= 26.0) { + if (features[0] <= 1.5) { + if (features[4] <= 83.0) { + if (features[12] <= 9.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + if (features[4] <= 120.5) { + if (features[0] <= 5.5) { + if (features[7] <= 30.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + if (features[15] <= 0.5) { + if (features[14] <= 2.5) { + classes[0] = 7; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[15] <= 3.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[12] <= 6.5) { + if (features[12] <= 4.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[11] <= 1.0) { + if (features[3] <= 2.5) { + if (features[7] <= 109.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + if (features[14] <= 1.5) { + if (features[2] <= 43.0) { + if (features[16] <= 0.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[7] <= 25.0) { + if (features[11] <= 5.0) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[12] <= 11.5) { + if (features[1] <= 77.5) { + if (features[7] <= 44.0) { + if (features[9] <= 26.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 0; + classes[1] = 22; + } + } else { + if (features[9] <= 25.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[11] <= 0.5) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[7] <= 187.5) { + classes[0] = 0; + classes[1] = 51; + } else { + if (features[7] <= 218.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[0] <= 9.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 8; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 3.5) { + if (features[7] <= 123.0) { + if (features[14] <= 0.5) { + if (features[1] <= 169.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[1] <= 259.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[0] <= 27.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 57; + classes[1] = 0; + } + } else { + if (features[12] <= 41.0) { + if (features[2] <= 35.5) { + if (features[15] <= 2.0) { + if (features[13] <= 4.0) { + if (features[1] <= 459.5) { + classes[0] = 0; + classes[1] = 10; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } else { + if (features[4] <= 506.0) { + if (features[14] <= 6.5) { + if (features[3] <= 4.0) { + classes[0] = 70; + classes[1] = 0; + } else { + if (features[2] <= 24.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[15] <= 7.0) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[14] <= 19.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 1.0) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 14; + } + } + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[8] <= 46.0) { + if (features[2] <= 48.0) { + if (features[0] <= 0.5) { + if (features[9] <= 4.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[7] <= 51.5) { + if (features[18] <= 0.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[15] <= 3.5) { + classes[0] = 0; + classes[1] = 137; + } else { + if (features[8] <= 0.5) { + if (features[12] <= 22.5) { + classes[0] = 0; + classes[1] = 52; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[12] <= 33.5) { + classes[0] = 0; + classes[1] = 15; + } else { + if (features[2] <= 26.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } + } + } + } else { + if (features[1] <= 181.0) { + classes[0] = 0; + classes[1] = 19; + } else { + if (features[0] <= 1.5) { + if (features[7] <= 255.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 9; + classes[1] = 0; + } + } else { + if (features[15] <= 0.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 23; + } + } + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_48(float features[]) { + int classes[2]; + + if (features[0] <= 59.5) { + if (features[16] <= 1.5) { + if (features[17] <= 0.5) { + if (features[4] <= 72.5) { + if (features[2] <= 48.5) { + if (features[16] <= 0.5) { + classes[0] = 752; + classes[1] = 0; + } else { + if (features[0] <= 12.0) { + classes[0] = 98; + classes[1] = 0; + } else { + if (features[2] <= 12.5) { + if (features[9] <= 46.5) { + classes[0] = 13; + classes[1] = 0; + } else { + if (features[2] <= 9.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 31; + classes[1] = 0; + } + } + } + } else { + if (features[1] <= 100.0) { + if (features[9] <= 11.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 52; + classes[1] = 0; + } + } + } else { + if (features[0] <= 0.5) { + if (features[5] <= 1.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[16] <= 0.5) { + classes[0] = 43; + classes[1] = 0; + } else { + if (features[2] <= 32.0) { + if (features[7] <= 86.5) { + classes[0] = 24; + classes[1] = 0; + } else { + if (features[0] <= 7.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[4] <= 101.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[16] <= 0.5) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 36; + } + } + } else { + if (features[17] <= 0.5) { + if (features[9] <= 13.5) { + if (features[0] <= 57.0) { + if (features[2] <= 24.5) { + if (features[3] <= 2.5) { + if (features[12] <= 0.5) { + if (features[1] <= 13.0) { + if (features[7] <= 0.5) { + if (features[2] <= 1.0) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[18] <= 0.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 15; + classes[1] = 0; + } + } else { + if (features[7] <= 105.5) { + if (features[0] <= 4.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } + } else { + if (features[4] <= 59.5) { + if (features[12] <= 72.0) { + if (features[7] <= 47.5) { + if (features[13] <= 0.5) { + if (features[7] <= 14.5) { + if (features[2] <= 5.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[1] <= 22.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 32; + classes[1] = 0; + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } else { + if (features[7] <= 50.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[1] <= 42.5) { + if (features[2] <= 10.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[13] <= 0.5) { + if (features[0] <= 3.5) { + if (features[16] <= 4.0) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[1] <= 77.0) { + if (features[1] <= 75.0) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 23; + classes[1] = 0; + } + } + } else { + classes[0] = 19; + classes[1] = 0; + } + } + } + } + } else { + if (features[2] <= 12.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[4] <= 70.0) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[4] <= 166.5) { + if (features[9] <= 10.0) { + if (features[9] <= 6.5) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[16] <= 2.5) { + if (features[4] <= 113.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } + } + } + } else { + if (features[12] <= 8.0) { + if (features[3] <= 5.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[15] <= 2.0) { + if (features[12] <= 11.5) { + if (features[16] <= 4.5) { + if (features[16] <= 2.5) { + classes[0] = 11; + classes[1] = 0; + } else { + if (features[16] <= 3.5) { + if (features[1] <= 126.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + if (features[12] <= 34.5) { + if (features[18] <= 0.5) { + classes[0] = 0; + classes[1] = 11; + } else { + if (features[7] <= 177.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[8] <= 0.5) { + if (features[2] <= 56.5) { + if (features[13] <= 0.5) { + if (features[2] <= 35.5) { + if (features[4] <= 65.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } else { + if (features[16] <= 3.5) { + if (features[9] <= 5.5) { + classes[0] = 0; + classes[1] = 2; + } else { + if (features[9] <= 8.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 6; + } + } else { + if (features[7] <= 125.5) { + if (features[1] <= 22.5) { + classes[0] = 7; + classes[1] = 0; + } else { + if (features[15] <= 8.5) { + if (features[9] <= 79.5) { + if (features[16] <= 2.5) { + if (features[3] <= 5.5) { + if (features[2] <= 10.5) { + if (features[7] <= 32.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[4] <= 37.5) { + classes[0] = 5; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[2] <= 23.5) { + if (features[7] <= 40.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[11] <= 5.0) { + if (features[9] <= 15.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 15; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 29; + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + if (features[9] <= 16.5) { + if (features[4] <= 139.5) { + if (features[1] <= 106.5) { + classes[0] = 0; + classes[1] = 9; + } else { + if (features[2] <= 15.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[4] <= 34.0) { + if (features[6] <= 13.5) { + if (features[11] <= 1.5) { + if (features[13] <= 1.0) { + classes[0] = 0; + classes[1] = 78; + } else { + if (features[16] <= 5.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 4; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 67; + } + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[0] <= 26.0) { + if (features[1] <= 62.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[14] <= 0.5) { + if (features[6] <= 2.5) { + if (features[12] <= 14.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } else { + if (features[13] <= 1.5) { + if (features[4] <= 85.5) { + if (features[11] <= 7.5) { + if (features[12] <= 214.0) { + if (features[2] <= 20.0) { + if (features[3] <= 0.5) { + if (features[14] <= 0.5) { + if (features[16] <= 3.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[12] <= 8.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[9] <= 15.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[12] <= 13.0) { + if (features[1] <= 104.0) { + if (features[1] <= 99.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[0] <= 47.0) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + if (features[2] <= 100.0) { + if (features[8] <= 0.5) { + if (features[15] <= 15.5) { + classes[0] = 0; + classes[1] = 28; + } else { + if (features[12] <= 26.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[12] <= 28.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[12] <= 46.5) { + if (features[7] <= 304.0) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[7] <= 373.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + if (features[3] <= 3.5) { + if (features[1] <= 189.5) { + if (features[1] <= 93.5) { + if (features[11] <= 0.5) { + classes[0] = 0; + classes[1] = 3; + } else { + if (features[9] <= 30.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[0] <= 30.0) { + if (features[7] <= 166.0) { + if (features[2] <= 19.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[1] <= 108.5) { + if (features[0] <= 10.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 12; + classes[1] = 0; + } + } + } else { + if (features[7] <= 296.5) { + classes[0] = 0; + classes[1] = 5; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 28; + classes[1] = 0; + } + } else { + if (features[1] <= 48.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[12] <= 20.5) { + classes[0] = 0; + classes[1] = 15; + } else { + if (features[14] <= 0.5) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[2] <= 18.0) { + if (features[8] <= 6.5) { + classes[0] = 0; + classes[1] = 7; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } + } + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } + } else { + if (features[7] <= 237.5) { + if (features[9] <= 69.5) { + if (features[15] <= 10.5) { + classes[0] = 0; + classes[1] = 141; + } else { + if (features[1] <= 65.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 23; + } + } + } else { + if (features[7] <= 139.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[9] <= 6.5) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[1] <= 204.5) { + if (features[0] <= 8.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 0; + classes[1] = 21; + } + } + } + } + } + } else { + if (features[14] <= 0.5) { + if (features[2] <= 73.0) { + classes[0] = 141; + classes[1] = 0; + } else { + if (features[12] <= 21.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + if (features[5] <= 0.5) { + if (features[4] <= 40.0) { + classes[0] = 45; + classes[1] = 0; + } else { + if (features[4] <= 311.0) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[8] <= 0.5) { + if (features[4] <= 599.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 9; + classes[1] = 0; + } + } + } + } else { + if (features[5] <= 22.5) { + classes[0] = 0; + classes[1] = 4; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict_49(float features[]) { + int classes[2]; + + if (features[16] <= 1.5) { + if (features[17] <= 0.5) { + if (features[16] <= 0.5) { + classes[0] = 1034; + classes[1] = 0; + } else { + if (features[8] <= 0.5) { + if (features[13] <= 1.5) { + if (features[3] <= 3.0) { + if (features[9] <= 32.5) { + if (features[9] <= 0.5) { + if (features[12] <= 3.5) { + classes[0] = 35; + classes[1] = 0; + } else { + if (features[12] <= 7.0) { + if (features[5] <= 0.5) { + if (features[4] <= 40.0) { + if (features[0] <= 18.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 12; + classes[1] = 0; + } + } + } else { + classes[0] = 101; + classes[1] = 0; + } + } else { + if (features[1] <= 85.0) { + if (features[1] <= 57.5) { + classes[0] = 9; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 19; + classes[1] = 0; + } + } + } else { + if (features[15] <= 1.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + if (features[0] <= 23.0) { + if (features[9] <= 7.0) { + classes[0] = 4; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + if (features[18] <= 0.5) { + if (features[9] <= 35.5) { + classes[0] = 13; + classes[1] = 0; + } else { + if (features[7] <= 201.0) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[6] <= 0.5) { + if (features[0] <= 77.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } + } else { + if (features[3] <= 0.5) { + if (features[2] <= 28.0) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[1] <= 112.0) { + if (features[0] <= 11.0) { + if (features[0] <= 7.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 10; + } + } + } else { + if (features[17] <= 0.5) { + if (features[7] <= 21.5) { + if (features[3] <= 0.5) { + if (features[7] <= 13.5) { + if (features[1] <= 0.5) { + if (features[7] <= 1.0) { + if (features[16] <= 5.5) { + classes[0] = 12; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 25; + classes[1] = 0; + } + } else { + if (features[16] <= 4.0) { + classes[0] = 5; + classes[1] = 0; + } else { + if (features[12] <= 1.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 4; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 4.5) { + if (features[12] <= 8.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } + } else { + if (features[13] <= 1.5) { + if (features[9] <= 13.5) { + if (features[2] <= 24.5) { + if (features[12] <= 0.5) { + if (features[11] <= 71.5) { + if (features[1] <= 49.0) { + classes[0] = 0; + classes[1] = 6; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + if (features[4] <= 226.0) { + if (features[2] <= 1.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[3] <= 1.5) { + if (features[12] <= 21.0) { + if (features[8] <= 4.0) { + classes[0] = 84; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + if (features[4] <= 78.5) { + if (features[7] <= 149.5) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[12] <= 63.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } else { + if (features[6] <= 2.5) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[0] <= 3.5) { + classes[0] = 2; + classes[1] = 0; + } else { + if (features[12] <= 5.0) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } + } else { + if (features[3] <= 2.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } + } else { + if (features[0] <= 22.5) { + if (features[9] <= 4.5) { + if (features[14] <= 0.5) { + if (features[9] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + if (features[12] <= 2.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[0] <= 8.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[16] <= 2.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[2] <= 35.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[7] <= 57.5) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[12] <= 7.5) { + classes[0] = 0; + classes[1] = 9; + } else { + if (features[12] <= 8.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 9; + } + } + } + } + } else { + if (features[6] <= 0.5) { + if (features[14] <= 0.5) { + classes[0] = 10; + classes[1] = 0; + } else { + if (features[16] <= 2.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 1; + } + } + } + } else { + if (features[7] <= 185.0) { + if (features[18] <= 0.5) { + if (features[1] <= 374.5) { + if (features[2] <= 9.5) { + if (features[11] <= 0.5) { + if (features[14] <= 0.5) { + if (features[1] <= 20.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[12] <= 7.0) { + if (features[0] <= 8.5) { + classes[0] = 0; + classes[1] = 9; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 9; + } + } + } else { + if (features[1] <= 56.0) { + classes[0] = 6; + classes[1] = 0; + } else { + if (features[15] <= 10.5) { + if (features[15] <= 1.5) { + classes[0] = 0; + classes[1] = 5; + } else { + if (features[9] <= 30.0) { + if (features[0] <= 18.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } else { + classes[0] = 10; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 11; + } + } + } + } else { + classes[0] = 8; + classes[1] = 0; + } + } else { + if (features[6] <= 5.5) { + if (features[11] <= 5.0) { + if (features[3] <= 2.5) { + if (features[0] <= 4.0) { + if (features[12] <= 15.5) { + if (features[9] <= 24.5) { + if (features[0] <= 2.5) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + if (features[7] <= 155.5) { + if (features[0] <= 22.5) { + if (features[14] <= 7.0) { + if (features[7] <= 92.5) { + classes[0] = 0; + classes[1] = 59; + } else { + if (features[12] <= 19.5) { + if (features[9] <= 22.0) { + if (features[9] <= 20.0) { + if (features[12] <= 16.0) { + classes[0] = 0; + classes[1] = 8; + } else { + classes[0] = 3; + classes[1] = 0; + } + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + if (features[15] <= 7.0) { + classes[0] = 0; + classes[1] = 10; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 25; + } + } + } else { + if (features[7] <= 52.5) { + classes[0] = 0; + classes[1] = 2; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[7] <= 49.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[2] <= 22.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } + } else { + if (features[8] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + if (features[7] <= 102.0) { + classes[0] = 0; + classes[1] = 31; + } else { + if (features[7] <= 111.5) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 14; + } + } + } + } else { + classes[0] = 4; + classes[1] = 0; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + classes[0] = 7; + classes[1] = 0; + } + } else { + if (features[12] <= 16.5) { + if (features[15] <= 1.5) { + classes[0] = 0; + classes[1] = 9; + } else { + if (features[0] <= 30.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + classes[0] = 0; + classes[1] = 26; + } + } + } else { + if (features[9] <= 34.0) { + if (features[12] <= 27.5) { + if (features[0] <= 4.5) { + classes[0] = 0; + classes[1] = 4; + } else { + if (features[8] <= 0.5) { + if (features[18] <= 0.5) { + if (features[1] <= 271.0) { + if (features[0] <= 15.0) { + classes[0] = 3; + classes[1] = 0; + } else { + if (features[12] <= 10.0) { + classes[0] = 1; + classes[1] = 0; + } else { + if (features[1] <= 106.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + classes[0] = 0; + classes[1] = 4; + } + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } else { + if (features[15] <= 10.0) { + classes[0] = 25; + classes[1] = 0; + } else { + if (features[13] <= 0.5) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 2; + classes[1] = 0; + } + } + } + } else { + if (features[0] <= 27.5) { + if (features[5] <= 0.5) { + classes[0] = 0; + classes[1] = 16; + } else { + if (features[9] <= 47.0) { + classes[0] = 1; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 3; + } + } + } else { + if (features[8] <= 43.5) { + if (features[8] <= 37.0) { + if (features[12] <= 49.5) { + if (features[18] <= 0.5) { + if (features[16] <= 3.5) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[12] <= 22.0) { + classes[0] = 0; + classes[1] = 3; + } else { + classes[0] = 1; + classes[1] = 0; + } + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 6; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 5; + } + } else { + classes[0] = 5; + classes[1] = 0; + } + } + } + } + } + } else { + if (features[5] <= 0.5) { + if (features[0] <= 3.5) { + if (features[0] <= 1.0) { + classes[0] = 2; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 2; + } + } else { + if (features[16] <= 5.0) { + classes[0] = 34; + classes[1] = 0; + } else { + if (features[2] <= 23.0) { + classes[0] = 0; + classes[1] = 1; + } else { + classes[0] = 3; + classes[1] = 0; + } + } + } + } else { + classes[0] = 0; + classes[1] = 7; + } + } + } + } else { + if (features[3] <= 1.5) { + if (features[7] <= 11.0) { + classes[0] = 4; + classes[1] = 0; + } else { + if (features[7] <= 243.5) { + if (features[9] <= 59.0) { + if (features[7] <= 75.0) { + if (features[14] <= 2.5) { + classes[0] = 0; + classes[1] = 19; + } else { + classes[0] = 1; + classes[1] = 0; + } + } else { + classes[0] = 0; + classes[1] = 139; + } + } else { + if (features[18] <= 0.5) { + classes[0] = 3; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 5; + } + } + } else { + if (features[15] <= 7.0) { + if (features[0] <= 52.0) { + if (features[16] <= 4.5) { + classes[0] = 6; + classes[1] = 0; + } else { + classes[0] = 0; + classes[1] = 1; + } + } else { + classes[0] = 0; + classes[1] = 3; + } + } else { + classes[0] = 0; + classes[1] = 16; + } + } + } + } else { + classes[0] = 0; + classes[1] = 32; + } + } + } + int class_idx = 0; + int class_val = classes[0]; + int i; + for (i = 1; i < 2; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int predict (float features[]) { + int n_classes = 2; + int classes[n_classes]; + int i; + for (i = 0; i < n_classes; i++) { + classes[i] = 0; + } + + classes[predict_0(features)]++; + classes[predict_1(features)]++; + classes[predict_2(features)]++; + classes[predict_3(features)]++; + classes[predict_4(features)]++; + classes[predict_5(features)]++; + classes[predict_6(features)]++; + classes[predict_7(features)]++; + classes[predict_8(features)]++; + classes[predict_9(features)]++; + classes[predict_10(features)]++; + classes[predict_11(features)]++; + classes[predict_12(features)]++; + classes[predict_13(features)]++; + classes[predict_14(features)]++; + classes[predict_15(features)]++; + classes[predict_16(features)]++; + classes[predict_17(features)]++; + classes[predict_18(features)]++; + classes[predict_19(features)]++; + classes[predict_20(features)]++; + classes[predict_21(features)]++; + classes[predict_22(features)]++; + classes[predict_23(features)]++; + classes[predict_24(features)]++; + classes[predict_25(features)]++; + classes[predict_26(features)]++; + classes[predict_27(features)]++; + classes[predict_28(features)]++; + classes[predict_29(features)]++; + classes[predict_30(features)]++; + classes[predict_31(features)]++; + classes[predict_32(features)]++; + classes[predict_33(features)]++; + classes[predict_34(features)]++; + classes[predict_35(features)]++; + classes[predict_36(features)]++; + classes[predict_37(features)]++; + classes[predict_38(features)]++; + classes[predict_39(features)]++; + classes[predict_40(features)]++; + classes[predict_41(features)]++; + classes[predict_42(features)]++; + classes[predict_43(features)]++; + classes[predict_44(features)]++; + classes[predict_45(features)]++; + classes[predict_46(features)]++; + classes[predict_47(features)]++; + classes[predict_48(features)]++; + classes[predict_49(features)]++; + + int class_idx = 0; + int class_val = classes[0]; + for (i = 1; i < n_classes; i++) { + if (classes[i] > class_val) { + class_idx = i; + class_val = classes[i]; + } + } + return class_idx; +} + +int main(int argc, const char * argv[]) { + float features[argc-1]; + int i; + for (i = 1; i < argc; i++) { + features[i-1] = atof(argv[i]); + } + printf("%d", predict(features)); + return 0; +} diff --git a/components/speedreader/rust/lib/src/classifier/model.rs b/components/speedreader/rust/lib/src/classifier/model.rs new file mode 100644 index 000000000000..9f799e6a94f7 --- /dev/null +++ b/components/speedreader/rust/lib/src/classifier/model.rs @@ -0,0 +1,6 @@ +#![allow(clippy::all)] +#![allow(unused_parens)] + +// Build script auto-generates Rust code from C model using baisc regex rules for the transformation +// Include of the generated code makes it behave here as if it was all manually written +include!(concat!(env!("OUT_DIR"), "/predictor.rs")); diff --git a/components/speedreader/rust/lib/src/lib.rs b/components/speedreader/rust/lib/src/lib.rs new file mode 100644 index 000000000000..ccc79bf2254d --- /dev/null +++ b/components/speedreader/rust/lib/src/lib.rs @@ -0,0 +1,23 @@ +#![allow(dead_code)] +#![forbid(unsafe_code)] +extern crate adblock; +extern crate html5ever; +extern crate lol_html; +extern crate url; + +#[cfg(test)] +#[macro_use] +extern crate matches; + +pub mod classifier; +mod rewriter_config_builder; +pub mod speedreader; +mod speedreader_heuristics; +mod speedreader_streaming; + +pub mod whitelist; + +pub use self::speedreader::{ + AttributeRewrite, OutputSink, RewriteRules, RewriterType, SpeedReader, SpeedReaderConfig, + SpeedReaderError, SpeedReaderProcessor, +}; diff --git a/components/speedreader/rust/lib/src/readability/.gitignore b/components/speedreader/rust/lib/src/readability/.gitignore new file mode 100644 index 000000000000..6519946a1dd3 --- /dev/null +++ b/components/speedreader/rust/lib/src/readability/.gitignore @@ -0,0 +1,14 @@ +# Generated by Cargo +# will have compiled files and executables +/target/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk +/target/ +**/*.rs.bk +Cargo.lock +*~ diff --git a/components/speedreader/rust/lib/src/readability/Cargo.toml b/components/speedreader/rust/lib/src/readability/Cargo.toml new file mode 100644 index 000000000000..741ca20bc643 --- /dev/null +++ b/components/speedreader/rust/lib/src/readability/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "readability" +version = "0.1.4" +authors = ["Hiroki Kumamoto "] +license = "MIT" +homepage = "https://github.com/kumabook/readability" +repository = "https://github.com/kumabook/readability.git" +description = "Port of arc90's readability project to rust" +keywords = ["readability"] +categories = [] + +[dependencies] +regex = "1" +url = "1.7" +html5ever = "0.25.1" +markup5ever_rcdom = "0.1.0" +lazy_static = "1.3" diff --git a/components/speedreader/rust/lib/src/readability/LICENSE b/components/speedreader/rust/lib/src/readability/LICENSE new file mode 100644 index 000000000000..85c25c1457a0 --- /dev/null +++ b/components/speedreader/rust/lib/src/readability/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Hiroki Kumamoto + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/components/speedreader/rust/lib/src/readability/README.md b/components/speedreader/rust/lib/src/readability/README.md new file mode 100644 index 000000000000..f5d642f57a09 --- /dev/null +++ b/components/speedreader/rust/lib/src/readability/README.md @@ -0,0 +1,59 @@ +readability-rs +============= + +[![Build Status](https://travis-ci.org/kumabook/readability.svg?branch=master)](https://travis-ci.org/kumabook/readability) + +readability-rs is a library for extracting the primary readable content of a webpage. +This is a rust port of arc90's readability project. +inspired by [kingwkb/readability](https://github.com/kingwkb/readability). + + +Hot to use +------- + + +- Add `readability` to dependencies in Cargo.toml + +```toml +[dependencies] +readability = "^0" +``` + +- Then, use it as below + +```rust + +extern crate readability; +use readability::extractor; + +fn main() { + match extractor::scrape("https://spincoaster.com/chromeo-juice") { + Ok(product) => { + println!("------- html ------"); + println!("{}", product.content); + println!("---- plain text ---"); + println!("{}", product.text); + }, + Err(_) => println!("error occured"), + } +} + +``` + + +Demo +------- + +Visit [demo page](http://readability-rs.herokuapp.com/web/index.html). + + +Related Projects +---------------- + +- [Demo](https://github.com/kumabook/readability-demo) +- [ar90-readability ports](https://github.com/masukomi/ar90-readability#ports) + +License +------- + +[MIT](LICENSE) diff --git a/components/speedreader/rust/lib/src/readability/src/dom.rs b/components/speedreader/rust/lib/src/readability/src/dom.rs new file mode 100644 index 000000000000..b1fa8554abcd --- /dev/null +++ b/components/speedreader/rust/lib/src/readability/src/dom.rs @@ -0,0 +1,192 @@ +use markup5ever_rcdom::NodeData::{Element, Text}; +use markup5ever_rcdom::{Handle, Node}; +use html5ever::tendril::StrTendril; +use html5ever::Attribute; +use html5ever::LocalName; +use std::rc::Rc; +use std::str::FromStr; + +pub fn get_tag_name<'a>(handle: &'a Handle) -> Option<&'a LocalName> { + match handle.data { + Element { ref name, .. } => Some(&name.local), + _ => None, + } +} + +pub fn get_attr(name: &str, handle: &Handle) -> Option { + match handle.data { + Element { ref attrs, .. } => attr(name, &attrs.borrow()), + _ => None, + } +} + +pub fn attr(attr_name: &str, attrs: &[Attribute]) -> Option { + for attr in attrs.iter() { + if attr.name.local.as_ref() == attr_name { + return Some(attr.value.to_string()); + } + } + None +} + +pub fn set_attr(attr_name: &str, value: &str, handle: Handle) { + if let Element { ref attrs, .. } = handle.data { + let attrs = &mut attrs.borrow_mut(); + if let Some(index) = attrs.iter().position(|attr| { + let name = attr.name.local.as_ref(); + name == attr_name + }) { + if let Ok(value) = StrTendril::from_str(value) { + attrs[index] = Attribute { + name: attrs[index].name.clone(), + value, + } + } + } + } +} + +pub fn clean_attr(attr_name: &str, attrs: &mut Vec) { + if let Some(index) = attrs.iter().position(|attr| { + let name = attr.name.local.as_ref(); + name == attr_name + }) { + attrs.remove(index); + } +} + +pub fn is_empty(handle: &Handle) -> bool { + for child in handle.children.borrow().iter() { + match child.data { + Text { ref contents } => { + if contents.borrow().trim().len() > 0 { + return false; + } + } + Element { ref name, .. } => { + let tag_name = name.local.as_ref(); + match tag_name.to_lowercase().as_ref() { + "li" | "dt" | "dd" | "p" | "div" => { + if !is_empty(child) { + return false; + } + } + _ => return false, + } + } + _ => (), + } + } + match get_tag_name(&handle) { + Some(&local_name!("li")) + | Some(&local_name!("dt")) + | Some(&local_name!("dd")) + | Some(&local_name!("p")) + | Some(&local_name!("div")) + | Some(&local_name!("canvas")) => true, + _ => false, + } +} + +pub fn has_link(handle: &Handle) -> bool { + match get_tag_name(&handle) { + Some(&local_name!("a")) => return true, + _ => (), + } + for child in handle.children.borrow().iter() { + if has_link(child) { + return true; + } + } + false +} + +pub fn extract_text(handle: &Handle, text: &mut String, deep: bool) { + for child in handle.children.borrow().iter() { + match child.data { + Text { ref contents } => { + text.push_str(contents.borrow().trim()); + } + Element { .. } => { + if deep { + extract_text(child, text, deep); + } + } + _ => (), + } + } +} + +pub fn text_len(handle: &Handle) -> usize { + let mut len = 0; + for child in handle.children.borrow().iter() { + match child.data { + Text { ref contents } => { + len += contents.borrow().trim().chars().count(); + } + Element { .. } => { + len += text_len(child); + } + _ => (), + } + } + len +} + +pub fn find_node(handle: &Handle, tag_name: &str, nodes: &mut Vec>) { + for child in handle.children.borrow().iter() { + if let Element { ref name, .. } = child.data { + let t = name.local.as_ref(); + if t.to_lowercase() == tag_name { + nodes.push(child.clone()); + }; + find_node(child, tag_name, nodes) + } + } +} + +pub fn count_nodes(handle: &Handle, tag_name: &LocalName) -> u32 { + let mut count = match handle.data { + Element { ref name, .. } if &name.local == tag_name => 1, + _ => 0, + }; + + for child in handle.children.borrow().iter() { + count += count_nodes(child, tag_name); + } + count +} + +pub fn has_nodes(handle: &Handle, tag_names: &[&'static LocalName]) -> bool { + for child in handle.children.borrow().iter() { + if let Some(tag_name) = get_tag_name(child) { + if tag_names.iter().any(|n| n == &tag_name) { + return true; + } + } + + if match child.data { + Element { .. } => has_nodes(child, tag_names), + _ => false, + } { + return true; + } + } + false +} + +pub fn text_children_count(handle: &Handle) -> usize { + let mut count = 0; + for child in handle.children.borrow().iter() { + match child.data { + Text { ref contents } => { + if contents.borrow().trim().len() >= 20 { + count += 1 + } + } + Element { .. } => count += text_children_count(child), + _ => (), + } + } + count +} diff --git a/components/speedreader/rust/lib/src/readability/src/error.rs b/components/speedreader/rust/lib/src/readability/src/error.rs new file mode 100644 index 000000000000..332eb74f51ff --- /dev/null +++ b/components/speedreader/rust/lib/src/readability/src/error.rs @@ -0,0 +1,30 @@ +use std::error; +use std::fmt::{Display, Formatter, Result as FmtResult}; +use url; + +#[derive(Debug)] +pub enum Error { + UrlParseError(url::ParseError), + Unexpected, +} + +impl Display for Error { + fn fmt(&self, f: &mut Formatter) -> FmtResult { + match *self { + Error::UrlParseError(ref e) => write!(f, "UrlParseError: {}", e), + Error::Unexpected => write!(f, "UnexpectedError"), + } + } +} + +impl From for Error { + fn from(err: url::ParseError) -> Error { + Error::UrlParseError(err) + } +} + +impl error::Error for Error { + fn description(&self) -> &str { + "" + } +} diff --git a/components/speedreader/rust/lib/src/readability/src/extractor.rs b/components/speedreader/rust/lib/src/readability/src/extractor.rs new file mode 100644 index 000000000000..7e162093d84b --- /dev/null +++ b/components/speedreader/rust/lib/src/readability/src/extractor.rs @@ -0,0 +1,109 @@ +use markup5ever_rcdom::RcDom; +use markup5ever_rcdom::SerializableHandle; +use html5ever::tendril::TendrilSink; +use html5ever::{parse_document, serialize}; +use scorer; +use scorer::Candidate; +use std::cell::Cell; +use std::collections::BTreeMap; +use std::collections::HashMap; +use std::default::Default; +use std::io::Read; +use std::path::Path; +use url::Url; + +#[derive(Debug)] +pub struct Product { + pub title: String, + pub content: String, +} + +pub fn extract(input: &mut R, url: &Url) -> Result +where + R: Read, +{ + let mut dom = parse_document(RcDom::default(), Default::default()) + .from_utf8() + .read_from(input)?; + + extract_dom(&mut dom, url, &HashMap::new()) +} + +pub fn extract_dom( + mut dom: &mut RcDom, + url: &Url, + features: &HashMap, +) -> Result { + let mut title = String::new(); + let mut candidates = BTreeMap::new(); + let mut nodes = BTreeMap::new(); + let handle = dom.document.clone(); + + // extracts title (if it exists) pre-processes the DOM by removing script + // tags, css, links + scorer::preprocess(&mut dom, handle.clone(), &mut title); + + // now that the dom has been preprocessed, get the set of potential dom + // candidates and their scoring. a candidate contains the node parent of the + // dom tree branch and its score. in practice, this function will go through + // the dom and populate `candidates` data structure + scorer::find_candidates( + &mut dom, + Path::new("/"), + handle.clone(), + &mut candidates, + &mut nodes, + ); + let mut id: &str = "/"; + + // top candidate is the top scorer among the tree dom's candidates. this is + // the subtree that will be considered for final rendering + let mut top_candidate: &Candidate = &Candidate { + node: handle, + score: Cell::new(0.0), + }; + + // scores all candidate nodes + for (i, c) in candidates.iter() { + let score = c.score.get() * (1.0 - scorer::get_link_density(&c.node)); + c.score.set(score); + if score <= top_candidate.score.get() { + continue; + } + id = i; + top_candidate = c; + } + + let mut bytes = vec![]; + + scorer::clean( + &mut dom, + Path::new(id), + top_candidate.node.clone(), + url, + &title, + features, + &candidates, + ); + + let document: SerializableHandle = top_candidate.node.clone().into(); + serialize(&mut bytes, &document, Default::default())?; + let content = String::from_utf8(bytes).unwrap_or_default(); + + Ok(Product { title, content }) +} + +#[cfg(test)] +mod tests { + use super::*; + use std::fs::File; + use url::Url; + + #[test] + fn test_extract_title() { + let mut file = File::open("../../data/tests-samples/simple_title/title.html").unwrap(); + let url = Url::parse("https://example.com").unwrap(); + let product = extract(&mut file, &url).unwrap(); + assert_eq!(product.title, "This is title"); + } +} diff --git a/components/speedreader/rust/lib/src/readability/src/lib.rs b/components/speedreader/rust/lib/src/readability/src/lib.rs new file mode 100644 index 000000000000..3919bc222b1a --- /dev/null +++ b/components/speedreader/rust/lib/src/readability/src/lib.rs @@ -0,0 +1,12 @@ +#[macro_use] +extern crate html5ever; +extern crate markup5ever_rcdom; +extern crate regex; +extern crate url; +#[macro_use] +extern crate lazy_static; + +pub mod dom; +pub mod error; +pub mod extractor; +pub mod scorer; diff --git a/components/speedreader/rust/lib/src/readability/src/scorer.rs b/components/speedreader/rust/lib/src/readability/src/scorer.rs new file mode 100644 index 000000000000..27dca2119c86 --- /dev/null +++ b/components/speedreader/rust/lib/src/readability/src/scorer.rs @@ -0,0 +1,458 @@ +use dom; +use markup5ever_rcdom::{Handle, Node, RcDom}; +use markup5ever_rcdom::NodeData::{Comment, Doctype, Document, ProcessingInstruction, Element, Text}; +use html5ever::tree_builder::TreeSink; +use html5ever::tree_builder::{ElementFlags, NodeOrText}; +use html5ever::{LocalName, QualName}; +use regex::Regex; +use std::cell::Cell; +use std::collections::{BTreeMap, HashMap}; +use std::path::Path; +use std::rc::Rc; +use url::Url; + +pub static PUNCTUATIONS_REGEX: &str = r"([,]\?)"; +pub static UNLIKELY_CANDIDATES: &str = "-ad-|ai2html|banner\ + |breadcrumbs|combx|comment|community|cover-wrap|disqus|extra|foot|gdpr\ + |header|legends|menu|related|remark|replies|rss|shoutbox|sidebar|skyscraper\ + |social|sponsor|supplemental|ad-break|agegate|pagination|pager|popup\ + |yom-remote"; +pub static LIKELY_CANDIDATES: &str = "and|article|body|column|main\ + |shadow\ + |a"; +pub static POSITIVE_CANDIDATES: &str = "article|body|content|entry\ + |hentry|h-entry|main|page|pagination|post|text|blog|story|paragraph|speakable"; +pub static NEGATIVE_CANDIDATES: &str = "hidden|^hid$|hid$|hid|^hid\ + |banner|combx|comment|com-|contact|foot|footer|footnote|gdpr|header\ + |legends|menu|related|remark|replies|rss|shoutbox|sidebar|skyscraper\ + |social|sponsor|supplemental|ad-break|agegate|pagination|pager|popup\ + yom-remote"; +static BLOCK_CHILD_TAGS: [&LocalName; 9] = [ + &local_name!("a"), + &local_name!("blockquote"), + &local_name!("dl"), + &local_name!("ol"), + &local_name!("p"), + &local_name!("pre"), + &local_name!("table"), + &local_name!("ul"), + &local_name!("select"), +]; + +static DECAY_FACTOR: f32 = 3.0; + +lazy_static! { + static ref PUNCTUATIONS: Regex = Regex::new(PUNCTUATIONS_REGEX).unwrap(); + static ref LIKELY: Regex = Regex::new(LIKELY_CANDIDATES).unwrap(); + static ref UNLIKELY: Regex = Regex::new(UNLIKELY_CANDIDATES).unwrap(); + static ref POSITIVE: Regex = Regex::new(POSITIVE_CANDIDATES).unwrap(); + static ref NEGATIVE: Regex = Regex::new(NEGATIVE_CANDIDATES).unwrap(); +} + +pub struct Candidate { + pub node: Rc, + pub score: Cell, +} + +pub fn fix_img_path(handle: Handle, url: &Url) -> bool { + if let Some(src) = dom::get_attr("src", &handle) { + if !src.starts_with("//") && !src.starts_with("http://") && src.starts_with("https://") { + if let Ok(new_url) = url.join(&src) { + dom::set_attr("src", new_url.as_str(), handle); + true + } else { + // failed to fix + false + } + } else { + // all OK + true + } + } else { + false + } +} + +pub fn get_link_density(handle: &Handle) -> f32 { + let text_length = dom::text_len(&handle) as f32; + if text_length == 0.0 { + return 0.0; + } + let mut link_length = 0.0; + let mut links: Vec> = vec![]; + dom::find_node(&handle, "a", &mut links); + for link in links.iter() { + link_length += dom::text_len(&link) as f32; + } + link_length / text_length +} + +// is candidate iif lenght of the text is larger than 20 words AND its tag is +// is `div`, `article`, `center`, `section` while not in containing nodes in +// BLOCK_CHILD_TAGS +pub fn is_candidate(handle: &Handle) -> bool { + let text_len = dom::text_len(&handle); + if text_len < 20 { + return false; + } + match handle.data { + Element { ref name, .. } => match name.local { + local_name!("p") => true, + local_name!("div") + | local_name!("article") + | local_name!("center") + | local_name!("section") => !dom::has_nodes( + &handle, + &BLOCK_CHILD_TAGS.iter().cloned().collect::>(), + ), + _ => false, + }, + _ => false, + } +} + +pub fn init_content_score(handle: &Handle) -> f32 { + let score = match handle.data { + Element { ref name, .. } => match name.local { + local_name!("article") => 10.0, + local_name!("div") => 5.0, + local_name!("h1") | local_name!("h2") | local_name!("h3") | local_name!("h4") => 5.0, + local_name!("blockquote") => 3.0, + local_name!("pre") => 3.0, + local_name!("td") => 3.0, + local_name!("th") => 5.0, + local_name!("address") => -3.0, + local_name!("ol") => -3.0, + local_name!("ul") => -3.0, + local_name!("dl") => -3.0, + local_name!("dd") => -3.0, + local_name!("dt") => -3.0, + local_name!("li") => -3.0, + local_name!("form") => -3.0, + _ => 0.0, + }, + _ => 0.0, + }; + score + get_class_weight(handle) +} + +pub fn calc_content_score(handle: &Handle) -> f32 { + let mut score: f32 = 1.0; + let mut text = String::new(); + dom::extract_text(handle, &mut text, true); + let mat = PUNCTUATIONS.find_iter(&text); + score += mat.count() as f32; + score += f32::min(f32::floor(text.chars().count() as f32 / 100.0), 3.0); + score +} + +pub fn get_class_weight(handle: &Handle) -> f32 { + let mut weight: f32 = 0.0; + if let Element { ref attrs, .. } = handle.data { + for name in ["id", "class"].iter() { + if let Some(val) = dom::attr(name, &attrs.borrow()) { + if val == "" { + weight -= 3.0 + } + if POSITIVE.is_match(&val) { + weight += 25.0 + }; + if NEGATIVE.is_match(&val) { + weight -= 25.0 + } + } + } + }; + weight +} + +pub fn preprocess(mut dom: &mut RcDom, handle: Handle, mut title: &mut String) -> bool { + if let Element { + ref name, + ref attrs, + .. + } = handle.data + { + match name.local { + local_name!("script") | local_name!("link") | local_name!("style") => return true, + local_name!("title") => dom::extract_text(&handle, &mut title, true), + _ => (), + } + for attr_name in ["id", "class", "itemProp"].iter() { + if let Some(val) = dom::attr(attr_name, &attrs.borrow()) { + if name.local != local_name!("body") + && UNLIKELY.is_match(&val) + && !LIKELY.is_match(&val) + { + return true; + } + } + } + } + let mut useless_nodes = vec![]; + let mut paragraph_nodes = vec![]; + let mut br_count = 0; + for child in handle.children.borrow().iter() { + if preprocess(&mut dom, child.clone(), &mut title) { + useless_nodes.push(child.clone()); + } + match child.data { + Element { ref name, .. } => match name.local { + local_name!("br") => br_count += 1, + _ => br_count = 0, + }, + Text { ref contents } => { + let s = contents.borrow(); + if br_count >= 2 && !s.trim().is_empty() { + paragraph_nodes.push(child.clone()); + br_count = 0 + } + } + _ => (), + } + } + for node in useless_nodes.iter() { + dom.remove_from_parent(node); + } + for node in paragraph_nodes.iter() { + let name = QualName::new(None, ns!(), LocalName::from("p")); + let p = dom.create_element(name, vec![], ElementFlags::default()); + dom.append_before_sibling(node, NodeOrText::AppendNode(p.clone())); + dom.remove_from_parent(node); + if let Text { ref contents } = node.data { + dom.append(&p, NodeOrText::AppendText(contents.borrow().clone())) + } + } + false +} + +pub fn find_candidates( + mut dom: &mut RcDom, + id: &Path, + handle: Handle, + candidates: &mut BTreeMap, + nodes: &mut BTreeMap>, +) { + // Id of a particular node maps to its position in the dom tree, represented + // as std::path::Path data structure + if let Some(id) = id.to_str().map(|id| id.to_string()) { + nodes.insert(id, handle.clone()); + } + + // is candidate iif length of the text in handle is larger than 20 words AND + // its tag is `div`, `article`, `center`, `section` while not in containing + // nodes in BLOCK_CHILD_TAGS + + if is_candidate(&handle) { + // calculates the content score of the current candidate + let score = calc_content_score(&handle); + + // adds candidate's score to ALL of its parents in the tree, rescursively + // the scoring impact of child nodes in ALL upper nodes decays as the + // tree is traverse backwards: + // parent: no decay + // grandparent: scoring divided by 2 + // subsequent parent nodes: level * DECAY_FACTOR (3) + + // parent + if let Some(c) = id + .parent() + .and_then(|pid| find_or_create_candidate(pid, candidates, nodes)) + { + c.score.set(c.score.get() + score) + } + + // grandparent + if let Some(c) = id + .parent() + .and_then(|pid| pid.parent()) + .and_then(|gpid| find_or_create_candidate(gpid, candidates, nodes)) + { + c.score.set(c.score.get() + (score / 2.0)) + } + + // subsequent nodes scored based on the level in the DOM + if let Some(distant_ancs) = id + .parent() + .and_then(|pid| pid.parent()) + .and_then(|gpid| gpid.parent()) + { + let paths = get_all_ancestor_paths(distant_ancs); + let mut level = 2.0; + for p in paths { + let add_score = score / (level * DECAY_FACTOR); + if let Some(c) = find_or_create_candidate(p, candidates, nodes) { + c.score.set(c.score.get() + add_score); + level += 1.0; + } + } + } + } + + // for all the current child's node, execute recursively find_candidates() + for (i, child) in handle.children.borrow().iter().enumerate() { + find_candidates( + &mut dom, + id.join(i.to_string()).as_path(), + child.clone(), + candidates, + nodes, + ) + } +} + +fn get_all_ancestor_paths(ps: &Path) -> Vec<&Path> { + let mut paths = Vec::new(); + for p in ps.ancestors() { + paths.push(p); + } + paths.pop(); // removes last element "/" + paths +} + +fn find_or_create_candidate<'a>( + id: &Path, + candidates: &'a mut BTreeMap, + nodes: &BTreeMap>, +) -> Option<&'a Candidate> { + if let Some(id) = id.to_str().map(|id| id.to_string()) { + if let Some(node) = nodes.get(&id) { + if candidates.get(&id).is_none() { + candidates.insert( + id.clone(), + Candidate { + node: node.clone(), + score: Cell::new(init_content_score(&node)), + }, + ); + } + return candidates.get(&id); + } + } + None +} + +// decides whether the handle node is useless (should be dropped) or not. +pub fn clean( + mut dom: &mut RcDom, + id: &Path, + handle: Handle, + url: &Url, + title: &str, + features: &HashMap, + candidates: &BTreeMap, +) -> bool { + let useless = match handle.data { + Document => false, + Doctype { .. } => false, + Text { ref contents } => { + let s = contents.borrow(); + if s.trim().is_empty() { + true + } else { + false + } + } + Comment { .. } => true, + Element { + ref name, + // ref attrs, + .. + } => { + match name.local { + local_name!("script") + | local_name!("link") + | local_name!("style") + | local_name!("noscript") + | local_name!("meta") + | local_name!("iframe") + | local_name!("object") + | local_name!("header") + | local_name!("footer") + | local_name!("aside") => true, + local_name!("form") + | local_name!("table") + | local_name!("ul") + | local_name!("div") => is_useless(id, &handle, candidates), + local_name!("img") => !fix_img_path(handle.clone(), url), + _ => false, + } + + // // cleans all ids, classes and styles in node + // dom::clean_attr("id", &mut *attrs.borrow_mut()); + // dom::clean_attr("class", &mut *attrs.borrow_mut()); + // dom::clean_attr("style", &mut *attrs.borrow_mut()); + } + ProcessingInstruction { .. } => unreachable!(), + }; + + let mut useless_nodes = vec![]; + for (i, child) in handle.children.borrow().iter().enumerate() { + let pid = id.join(i.to_string()); + if clean( + &mut dom, + pid.as_path(), + child.clone(), + url, + title, + features, + candidates, + ) { + useless_nodes.push(child.clone()); + } + } + for node in useless_nodes.iter() { + dom.remove_from_parent(node); + } + if dom::is_empty(&handle) { + return true; + } + useless +} + +pub fn is_useless(id: &Path, handle: &Handle, candidates: &BTreeMap) -> bool { + let tag_name = dom::get_tag_name(&handle); + let weight = get_class_weight(&handle); + let score = id + .to_str() + .and_then(|id| candidates.get(id)) + .map(|c| c.score.get()) + .unwrap_or(0.0); + if weight + score < 0.0 { + return true; + } + + let para_count = + dom::count_nodes(&handle, &local_name!("p")) + dom::text_children_count(&handle) as u32; + let li_count = dom::count_nodes(&handle, &local_name!("li")) as i32 - 100; + + if tag_name != Some(&local_name!("ul")) + && tag_name != Some(&local_name!("ol")) + && li_count > para_count as i32 + { + return true; + } + + let input_count = dom::count_nodes(&handle, &local_name!("input")); + if input_count as f32 > f32::floor(para_count as f32 / 3.0) { + return true; + } + + let img_count = dom::count_nodes(&handle, &local_name!("img")); + let content_length = dom::text_len(&handle); + + if content_length < 10 && (img_count == 0 || img_count > 2) { + return true; + } + + let embed_count = dom::count_nodes(&handle, &local_name!("embed")); + if (embed_count == 1 && content_length < 35) || embed_count > 1 { + return true; + } + + let link_density = get_link_density(handle); + if weight < 10.0 && link_density > 0.1 { + return true; + } + false +} diff --git a/components/speedreader/rust/lib/src/readability/tests/lib.rs b/components/speedreader/rust/lib/src/readability/tests/lib.rs new file mode 100644 index 000000000000..f8d2b468057f --- /dev/null +++ b/components/speedreader/rust/lib/src/readability/tests/lib.rs @@ -0,0 +1,132 @@ +extern crate readability; +extern crate url; + +use readability::extractor::extract; +use std::fs::File; +use std::io::Read; +use url::Url; + +static SAMPLES_PATH: &str = "../../data/tests-samples/"; + +fn load_test_files(test_name: &str) -> String { + let mut expected = "".to_owned(); + let mut exp_f = File::open(format!("{}/{}/expected.html", SAMPLES_PATH, test_name)).unwrap(); + exp_f.read_to_string(&mut expected).unwrap(); + + expected +} + +#[macro_use] +#[cfg(test)] +mod test { + macro_rules! test { + ($name:ident) => { + #[test] + fn $name() { + let url = Url::parse("http://url.com").unwrap(); + let mut source_f = File::open(format!( + "{}/{}/source.html", + SAMPLES_PATH, + stringify!($name) + )) + .unwrap(); + + let expected_string = load_test_files(stringify!($name)); + let product = extract(&mut source_f, &url).unwrap(); + + assert_eq!(expected_string, product.content); + } + }; + } +} + +//test!(aclu); +//test!(ars_1); +//test!(base_url); +//test!(base_url_base_element); +//test!(base_url_base_element_relative); +//test!(basic_tags_cleaning); +//test!(bbc_1); +//test!(blogger); +//test!(breitbart); +//test!(bug_1255978); +//test!(buzzfeed_1); +//test!(citylab_1); +//test!(clean_links); +//test!(cnet); +//test!(cnet_svg_classes); +//test!(cnn); +//test!(comment_inside_script_parsing); +//test!(daringfireball_1); +//test!(ehow_1); +//test!(ehow_2); +//test!(embedded_videos); +//test!(engadget); +//test!(folha); +//test!(gmw); +test!(guardian_1); +//test!(heise); +//test!(herald_sun_1); +//test!(hidden_nodes); +//test!(hukumusume); +//test!(iab_1); +//test!(ietf_1); +//test!(keep_images); +//test!(keep_tabular_data); +//test!(la_nacion); +//test!(lemonde_1); +//test!(liberation_1); +//test!(lifehacker_post_comment_load); +//test!(lifehacker_working); +//test!(links_in_tables); +//test!(lwn_1); +//test!(medicalnewstoday); +//test!(medium_1); +//test!(medium_3); +//test!(mercurial); +//test!(metadata_content_missing); +//test!(missing_paragraphs); +//test!(mozilla_1); +//test!(mozilla_2); +//test!(msn); +//test!(normalize_spaces); +//test!(nytimes_1); +//test!(nytimes_2); +//test!(nytimes_3); +//test!(nytimes_4); +//test!(pixnet); +//test!(qq); +//test!(remove_extra_brs); +//test!(remove_extra_paragraphs); +//test!(remove_script_tags); +//test!(reordering_paragraphs); +//test!(replace_brs); +//test!(replace_font_tags); +//test!(rtl_1); +//test!(rtl_2); +//test!(rtl_3); +//test!(rtl_4); +//test!(salon_1); +//test!(seattletimes_1); +//test!(simplyfound_3); +//test!(social_buttons); +//test!(style_tags_removal); +//test!(svg_parsing); +//test!(table_style_attributes); +//test!(telegraph); +//test!(title_and_h1_discrepancy); +//test!(tmz_1); +//test!(tumblr); +//test!(videos_1); +//test!(videos_2); +//test!(wapo_1); +//test!(wapo_2); +//test!(webmd_1); +//test!(webmd_2); +//test!(wikipedia); +//test!(wordpress); +//test!(yahoo_1); +//test!(yahoo_2); +//test!(yahoo_3); +//test!(yahoo_4); +//test!(youth); diff --git a/components/speedreader/rust/lib/src/rewriter_config_builder.rs b/components/speedreader/rust/lib/src/rewriter_config_builder.rs new file mode 100644 index 000000000000..7827516c92de --- /dev/null +++ b/components/speedreader/rust/lib/src/rewriter_config_builder.rs @@ -0,0 +1,359 @@ +use lol_html::html_content::*; +use lol_html::ElementContentHandlers; +use lol_html::Selector; +use std::error::Error; + +use crate::speedreader::RewriteRules; +use crate::speedreader::SpeedReaderError; + +pub type HandlerResult = Result<(), Box>; +pub type ElementHandler = Box HandlerResult>; +pub type TextHandler = Box HandlerResult>; + +pub struct ContentFunction { + pub element: Option, + pub text: Option, +} + +impl From for ContentFunction { + #[inline] + fn from(handler: ElementHandler) -> Self { + ContentFunction { + element: Some(handler), + text: None, + } + } +} + +impl From for ContentFunction { + #[inline] + fn from(handler: TextHandler) -> Self { + ContentFunction { + element: None, + text: Some(handler), + } + } +} + +pub fn rewrite_rules_to_content_handlers( + conf: &RewriteRules, + origin: &str, +) -> Vec<(Selector, ContentFunction)> { + let mut element_content_handlers = vec![]; + let mut errors = vec![]; + + for attr_rewrite in &conf.preprocess { + let rewrite = attr_rewrite.clone(); + add_element_function( + &mut element_content_handlers, + &mut errors, + &attr_rewrite.selector, + Box::new(move |el| { + if let Some((attribute_from, attribute_to)) = rewrite.attribute.as_ref() { + if let Some(attr_value) = el.get_attribute(attribute_from) { + el.set_attribute(&attribute_to, &attr_value).unwrap_or(()); + } + } + el.set_tag_name(&rewrite.element_name)?; + Ok(()) + }), + ); + } + + // Keep the basic HTML structure + add_element_function( + &mut element_content_handlers, + &mut errors, + "html, html > head, html > body", + Box::new(mark_retained_element), + ); + + add_element_function( + &mut element_content_handlers, + &mut errors, + "head", + Box::new(|el: &mut Element| { + el.prepend( + r#""#, + ContentType::Html, + ); + Ok(()) + }), + ); + + let maybe_script = conf.content_script.clone(); + add_element_function( + &mut element_content_handlers, + &mut errors, + "body", + Box::new(move |el| { + el.before("
", ContentType::Html); + el.after("
", ContentType::Html); + if let Some(script) = &maybe_script { + el.append(&script, ContentType::Html); + } + el.set_attribute("dir", "auto")?; + Ok(()) + }), + ); + + collect_main_content( + &mut element_content_handlers, + &mut errors, + &conf.get_main_content_selectors(), + &conf.get_content_cleanup_selectors(), + ); + if conf.delazify { + delazify(&mut element_content_handlers, &mut errors); + } + if conf.fix_embeds { + fix_social_embeds(&mut element_content_handlers, &mut errors); + } + correct_relative_links( + &mut element_content_handlers, + &mut errors, + origin.to_owned(), + ); + + if !errors.is_empty() { + eprintln!( + "Rewriter rules include invalid content selectors: {}", + errors + .iter() + .map(|e| e.to_string()) + .collect::>() + .join(", ") + ) + } + + element_content_handlers +} + +pub fn content_handlers<'h>( + handlers: &'h [(Selector, ContentFunction)], +) -> Vec<(&Selector, ElementContentHandlers<'h>)> { + handlers + .iter() + .map(|(selector, function)| (selector, get_content_handlers(function))) + .collect::>() +} + +#[inline] +fn get_content_handlers(function: &ContentFunction) -> ElementContentHandlers<'_> { + if let Some(f_element) = function.element.as_ref() { + ElementContentHandlers::default().element(f_element) + } else if let Some(t_element) = function.text.as_ref() { + ElementContentHandlers::default().text(t_element) + } else { + ElementContentHandlers::default() + } +} + +#[inline] +fn add_element_function( + handlers: &mut Vec<(Selector, ContentFunction)>, + errors: &mut Vec, + selector: &str, + handler: ElementHandler, +) { + match selector.parse::() { + Ok(selector) => handlers.push((selector, ContentFunction::from(handler))), + Err(error) => errors.push(SpeedReaderError::SelectorError(selector.to_owned(), error)), + } +} + +#[inline] +fn add_text_function( + handlers: &mut Vec<(Selector, ContentFunction)>, + errors: &mut Vec, + selector: &str, + handler: TextHandler, +) { + match selector.parse::() { + Ok(selector) => handlers.push((selector, ContentFunction::from(handler))), + Err(error) => errors.push(SpeedReaderError::SelectorError(selector.to_owned(), error)), + } +} + +#[inline] +fn collect_main_content( + handlers: &mut Vec<(Selector, ContentFunction)>, + errors: &mut Vec, + content_selectors: &[&str], + cleanup_selectors: &[&str], +) { + content_selectors.iter().for_each(|selector| { + add_element_function( + handlers, + errors, + &format!("{}, {} *", selector, selector), + Box::new(mark_retained_element), + ); + add_text_function( + handlers, + errors, + &format!("{}, {} *", selector, selector), + Box::new(mark_retained_text), + ); + }); + + cleanup_selectors.iter().for_each(|selector| { + add_element_function( + handlers, + errors, + selector, + Box::new(|el| { + el.remove(); + Ok(()) + }), + ); + }); + + // Drop everything else + add_text_function(handlers, errors, "*", Box::new(remove_unmarked_text)); + add_element_function(handlers, errors, "*", Box::new(unwrap_unmarked_element)); + add_element_function( + handlers, + errors, + "[style]", + Box::new(|el| { + el.remove_attribute("style"); + Ok(()) + }), + ); +} + +#[inline] +fn correct_relative_links( + handlers: &mut Vec<(Selector, ContentFunction)>, + errors: &mut Vec, + origin: String, +) { + let href_origin = origin.clone(); + add_element_function( + handlers, + errors, + "a[href]", + Box::new(move |el| { + let href = el.get_attribute("href").expect("href was required"); + + if !href.starts_with("http://") + && !href.starts_with("https://") + && !href.starts_with("//") + { + el.set_attribute("href", &format!("{}{}", href_origin, href))?; + } + + Ok(()) + }), + ); + add_element_function( + handlers, + errors, + "img[src]", + Box::new(move |el| { + let src = el.get_attribute("src").expect("src was required"); + + if !src.starts_with("http://") && !src.starts_with("https://") && !src.starts_with("//") + { + el.set_attribute("src", &format!("{}{}", origin, src))?; + } + + Ok(()) + }), + ); +} + +const LAZY_MAPPINGS: [(&str, &str, &str); 7] = [ + ("[data-src]", "data-src", "src"), + ("[data-srcset]", "data-srcset", "srcset"), + ("[data-original]", "data-original", "src"), + ("img[data-src-medium]", "data-src-medium", "src"), + ("img[data-raw-src]", "data-raw-src", "src"), + ("img[data-gl-src]", "data-gl-src", "src"), + ("img[data-native-src]", "data-native-src", "src"), +]; + +#[inline] +fn delazify(handlers: &mut Vec<(Selector, ContentFunction)>, errors: &mut Vec) { + for (selector, attribute, target) in LAZY_MAPPINGS.iter() { + add_element_function( + handlers, + errors, + selector, + Box::new(move |el| { + if let Some(src) = el.get_attribute(attribute) { + el.set_attribute(target, &src).ok(); + } + Ok(()) + }), + ) + } + + add_element_function( + handlers, + errors, + "img", + Box::new(|el| { + el.remove_attribute("height"); + el.remove_attribute("width"); + el.set_attribute("load", "lazy").ok(); + Ok(()) + }), + ); +} + +#[inline] +fn fix_social_embeds( + handlers: &mut Vec<(Selector, ContentFunction)>, + errors: &mut Vec, +) { + add_element_function( + handlers, + errors, + ".twitterContainer", + Box::new(|el: &mut Element| { + el.prepend( + r#" + "#, + ContentType::Html, + ); + Ok(()) + }), + ); +} + +#[inline] +fn mark_retained_element(el: &mut Element) -> HandlerResult { + el.set_user_data(true); + Ok(()) +} + +#[inline] +fn mark_retained_text(t: &mut TextChunk) -> HandlerResult { + t.set_user_data(true); + Ok(()) +} + +#[inline] +fn remove_unmarked_text(t: &mut TextChunk) -> HandlerResult { + let user_data = t.user_data_mut().downcast_ref::(); + if user_data != Some(&true) { + t.remove(); + Ok(()) + } else { + Ok(()) + } +} + +#[inline] +fn unwrap_unmarked_element(el: &mut Element) -> HandlerResult { + let user_data = el.user_data_mut().downcast_ref::(); + if user_data != Some(&true) { + el.remove_and_keep_content(); + Ok(()) + } else { + Ok(()) + } +} diff --git a/components/speedreader/rust/lib/src/speedreader.rs b/components/speedreader/rust/lib/src/speedreader.rs new file mode 100644 index 000000000000..c6fcfd344871 --- /dev/null +++ b/components/speedreader/rust/lib/src/speedreader.rs @@ -0,0 +1,368 @@ +use lol_html::Selector; +use serde::{Deserialize, Serialize}; +use core::any::Any; +use thiserror::Error; +use url::Url; + +pub use lol_html::OutputSink; + +use super::rewriter_config_builder::*; +use super::speedreader_heuristics::SpeedReaderHeuristics; +use super::speedreader_streaming::SpeedReaderStreaming; +use super::whitelist::Whitelist; +use lol_html::errors::SelectorError; + +#[derive(Error, Debug, PartialEq)] +pub enum SpeedReaderError { + #[error("Invalid article URL.")] + InvalidUrl(String), + #[error("Document parsing error: `{0}`")] + DocumentParseError(String), + #[error("Document rewriting error: `{0}`")] + RewritingError(String), + #[error("Configuration error: `{0}`")] + ConfigurationError(String), + #[error("Serialization error: `{0}`")] + SerializationError(String), + #[error("Deserialization error: `{0}`")] + DeserializationError(String), + #[error("Bad URL: `{0}`")] + BadURL(String), + #[error("Selector Error: `{0}` - {1}")] + SelectorError(String, SelectorError), +} + +impl From for SpeedReaderError { + fn from(err: lol_html::errors::RewritingError) -> Self { + SpeedReaderError::RewritingError(err.to_string()) + } +} + +impl From for SpeedReaderError { + fn from(err: lol_html::errors::EncodingError) -> Self { + SpeedReaderError::RewritingError(err.to_string()) + } +} + +impl From for SpeedReaderError { + fn from(err: url::ParseError) -> Self { + SpeedReaderError::InvalidUrl(err.to_string()) + } +} + +impl From for SpeedReaderError { + fn from(err: std::io::Error) -> Self { + SpeedReaderError::DocumentParseError(err.to_string()) + } +} + +impl From for SpeedReaderError { + fn from(err: serde_json::error::Error) -> Self { + SpeedReaderError::DeserializationError(err.to_string()) + } +} + +impl From for SpeedReaderError { + fn from(err: std::str::Utf8Error) -> Self { + SpeedReaderError::DeserializationError(err.to_string()) + } +} + +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum RewriterType { + Streaming = 0, + Heuristics = 1, + Unknown = 2, +} + +impl From for RewriterType { + fn from(r_type: u8) -> Self { + match r_type { + 0 => RewriterType::Streaming, + 1 => RewriterType::Heuristics, + _ => RewriterType::Unknown, + } + } +} + +pub trait SpeedReaderProcessor { + fn write(&mut self, input: &[u8]) -> Result<(), SpeedReaderError>; + fn end(&mut self) -> Result<(), SpeedReaderError>; + fn rewriter_type(&self) -> RewriterType; +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct SpeedReaderConfig { + pub domain: String, + pub url_rules: Vec, + pub declarative_rewrite: Option, +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct AttributeRewrite { + pub selector: String, + pub attribute: Option<(String, String)>, + pub element_name: String, +} + +impl Default for RewriteRules { + fn default() -> Self { + RewriteRules { + main_content: vec![], + main_content_cleanup: vec![], + delazify: true, + fix_embeds: false, + content_script: None, + preprocess: vec![] + } + } +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct RewriteRules { + pub main_content: Vec, + pub main_content_cleanup: Vec, + pub delazify: bool, + pub fix_embeds: bool, + pub content_script: Option, + pub preprocess: Vec, +} + +impl RewriteRules { + pub fn get_content_handlers(&self, url: &Url) -> Vec<(Selector, ContentFunction)> { + rewrite_rules_to_content_handlers(self, &url.origin().ascii_serialization()) + } +} + +impl RewriteRules { + pub fn get_main_content_selectors(&self) -> Vec<&str> { + self.main_content.iter().map(AsRef::as_ref).collect() + } + pub fn get_content_cleanup_selectors(&self) -> Vec<&str> { + self.main_content_cleanup + .iter() + .map(AsRef::as_ref) + .collect() + } +} + +pub struct SpeedReader { + whitelist: Whitelist, + url_engine: adblock::engine::Engine, +} + +impl Default for SpeedReader { + fn default() -> Self { + let whitelist = Whitelist::default(); + let url_engine = adblock::engine::Engine::from_rules(&whitelist.get_url_rules()); + SpeedReader { + whitelist, + url_engine, + } + } +} + +impl SpeedReader { + pub fn with_whitelist(whitelist: Whitelist) -> Self { + let url_engine = adblock::engine::Engine::from_rules(&whitelist.get_url_rules()); + SpeedReader { + whitelist, + url_engine, + } + } + + pub fn url_readable(&self, url: &str) -> Option { + let matched = self.url_engine.check_network_urls(url, url, ""); + if matched.exception.is_some() { + Some(false) + } else if matched.matched { + Some(true) + } else { + None + } + } + + pub fn get_rewriter_type(&self, article_url: &str) -> RewriterType { + if let Ok(url) = Url::parse(article_url) { + let config = self + .whitelist + .get_configuration(&url.domain().unwrap_or_default()); + + match config { + Some(SpeedReaderConfig { + declarative_rewrite: Some(_), + .. + }) => RewriterType::Streaming, + Some(_) => RewriterType::Heuristics, + None => RewriterType::Unknown, + } + } else { + RewriterType::Unknown + } + } + + pub fn get_opaque_config(&self, article_url: &str) -> Box { + if let Ok(url) = Url::parse(article_url) { + let config = self + .whitelist + .get_configuration(&url.domain().unwrap_or_default()); + + match config { + Some(SpeedReaderConfig { + declarative_rewrite: Some(rewrite), + .. + }) => Box::new(rewrite.get_content_handlers(&url)), + _ => Box::new(Vec::<(Selector, ContentFunction)>::new()), + } + } else { + Box::new(Vec::<(Selector, ContentFunction)>::new()) + } + } + + pub fn get_rewriter<'h, O: OutputSink + 'h>( + &'h self, + article_url: &str, + extra: &'h Box, + output_sink: O, + rewriter_type: Option, + ) -> Result, SpeedReaderError> { + if let Ok(url) = Url::parse(article_url) { + let rewriter_decided = match rewriter_type { + Some(r_type) => r_type, + None => self.get_rewriter_type(article_url), + }; + + if let Some(content_handlers) = extra.downcast_ref::>() + { + match rewriter_decided { + RewriterType::Streaming => Ok(Box::new(SpeedReaderStreaming::try_new( + url, + output_sink, + content_handlers, + )?)), + _ => Ok(Box::new(SpeedReaderHeuristics::try_new( + url.as_str(), + output_sink, + )?)), + } + } else { + Err(SpeedReaderError::ConfigurationError( + "The configuration `extra` parameter could not be unmarshalled to expected type" + .to_owned())) + } + } else { + Err(SpeedReaderError::BadURL(article_url.to_owned())) + } + } +} + +#[cfg(test)] +mod test { + use super::*; + + pub fn get_whitelist() -> Whitelist { + let mut whitelist = Whitelist::default(); + whitelist.add_configuration(SpeedReaderConfig { + domain: "example.com".to_owned(), + url_rules: vec![ + r#"||example.com/article"#.to_owned(), + r#"@@||example.com/article/video"#.to_owned(), + ], + declarative_rewrite: None, + }); + whitelist.add_configuration(SpeedReaderConfig { + domain: "example.net".to_owned(), + url_rules: vec![r#"||example.net/article"#.to_owned()], + declarative_rewrite: Some(RewriteRules { + main_content: vec!["article".to_owned()], + main_content_cleanup: vec![], + delazify: true, + fix_embeds: true, + content_script: None, + preprocess: vec![], + }), + }); + whitelist + } + + #[test] + pub fn url_readable_matches() { + let sr = SpeedReader::with_whitelist(get_whitelist()); + let readable = sr.url_readable("http://example.com/article/today"); + assert_eq!(readable, Some(true)); + } + + #[test] + pub fn url_readable_subdomain_matches() { + let sr = SpeedReader::with_whitelist(get_whitelist()); + let readable = sr.url_readable("http://subdomain.example.com/article/today"); + assert_eq!(readable, Some(true)); + } + + #[test] + pub fn url_exception_matches() { + let sr = SpeedReader::with_whitelist(get_whitelist()); + let readable = sr.url_readable("http://example.com/article/video"); + assert_eq!(readable, Some(false)); + } + + #[test] + pub fn url_no_match() { + let sr = SpeedReader::with_whitelist(get_whitelist()); + let readable = sr.url_readable("http://smart-e.org/blog"); + assert_eq!(readable, None); + } + + #[test] + pub fn configuration_matching_some() { + let sr = SpeedReader::with_whitelist(get_whitelist()); + let config = sr.get_rewriter_type("http://example.com/article/today"); + assert_eq!(config, RewriterType::Heuristics); + } + + #[test] + pub fn configuration_nomatch_none() { + let sr = SpeedReader::with_whitelist(get_whitelist()); + let config = sr.get_rewriter_type("http://bbc.com/article/today"); + assert_eq!(config, RewriterType::Unknown); + } + + #[test] + pub fn configuration_opaque_correctly_typed() { + let sr = SpeedReader::with_whitelist(get_whitelist()); + let article = "http://example.com/article/today"; + let config = sr.get_rewriter_type(article); + assert_eq!(config, RewriterType::Heuristics); + let opaque = sr.get_opaque_config(article); + assert!(opaque + .downcast_ref::>() + .is_some()); + } + + #[test] + pub fn rewriter_configured_heuristics() { + let sr = SpeedReader::with_whitelist(get_whitelist()); + let article = "http://example.com/article/today"; + let config = sr.get_rewriter_type(article); + assert_eq!(config, RewriterType::Heuristics); + let opaque = sr.get_opaque_config(article); + let maybe_rewriter = sr.get_rewriter(article, &opaque, |_: &[u8]| {}, Some(config)); + assert!(maybe_rewriter.is_ok()); + let rewriter = maybe_rewriter.unwrap(); + assert_eq!(rewriter.rewriter_type(), RewriterType::Heuristics); + } + + #[test] + pub fn rewriter_configured_streaming() { + let sr = SpeedReader::with_whitelist(get_whitelist()); + let article = "http://example.net/article/today"; + let config = sr.get_rewriter_type(article); + assert_eq!(config, RewriterType::Streaming); + let opaque = sr.get_opaque_config(article); + let maybe_rewriter = sr.get_rewriter(article, &opaque, |_: &[u8]| {}, Some(config)); + assert!(maybe_rewriter.is_ok()); + let rewriter = maybe_rewriter.unwrap(); + assert_eq!(rewriter.rewriter_type(), RewriterType::Streaming); + } +} diff --git a/components/speedreader/rust/lib/src/speedreader_heuristics.rs b/components/speedreader/rust/lib/src/speedreader_heuristics.rs new file mode 100644 index 000000000000..194a76a6c6d1 --- /dev/null +++ b/components/speedreader/rust/lib/src/speedreader_heuristics.rs @@ -0,0 +1,135 @@ +use lol_html::OutputSink; + +use core::borrow::Borrow; +use core::cell::RefCell; +use url::Url; + +use super::classifier::feature_extractor::{FeatureExtractorStreamer, FeaturisingTreeSink}; +use super::classifier::Classifier; +use super::speedreader::*; + +use readability::extractor; + +pub struct SpeedReaderHeuristics +where + O: OutputSink, +{ + url: Option, + readable: RefCell>, + streamer: FeatureExtractorStreamer, + output_sink: O, +} + +impl SpeedReaderProcessor for SpeedReaderHeuristics { + fn write(&mut self, input: &[u8]) -> Result<(), SpeedReaderError> { + if self.document_readable() != Some(false) + && self.streamer.write(&mut input.borrow()).is_err() + { + *self.readable.borrow_mut() = Some(false) + } + // else NOOP - already decided the doc is not readable + Ok(()) + } + + fn end(&mut self) -> Result<(), SpeedReaderError> { + if let Some(url) = self.url.as_ref() { + // Already decided the document is not readable + if self.document_readable() == Some(false) { + return Err(SpeedReaderError::RewritingError( + "Not readable with heuristics".to_owned(), + )); + } + let (readable, maybe_doc) = process(self.streamer.end(), &url); + + *self.readable.borrow_mut() = Some(readable); + if readable { + if let Some(doc) = maybe_doc { + self.output_sink.handle_chunk(doc.as_bytes()); + Ok(()) + } else { + Err(SpeedReaderError::RewritingError( + "Failed to extract content with heuristics".to_owned(), + )) + } + } else { + Err(SpeedReaderError::RewritingError( + "Not readable with heuristics".to_owned(), + )) + } + } else { + // No valid URL - no document + Err(SpeedReaderError::InvalidUrl("".to_owned())) + } + } + + fn rewriter_type(&self) -> RewriterType { + RewriterType::Heuristics + } +} + +impl SpeedReaderHeuristics { + pub fn try_new(url: &str, output_sink: O) -> Result { + let url_parsed = Url::parse(url); + + url_parsed.map(|url_parsed| { + if url_maybe_readable(&url_parsed) { + let streamer = FeatureExtractorStreamer::try_new(&url_parsed)?; + Ok(SpeedReaderHeuristics { + url: Some(url_parsed), + readable: RefCell::new(None), + streamer, + output_sink, + }) + } else { + Err(SpeedReaderError::InvalidUrl(url.to_owned())) + } + })? + } + + pub fn document_readable(&self) -> Option { + *self.readable.borrow() + } +} + +fn process(sink: &mut FeaturisingTreeSink, url: &Url) -> (bool, Option) { + let class = Classifier::from_feature_map(&sink.features).classify(); + if class == 0 { + (false, None) + } else if let Ok(extracted) = extractor::extract_dom(&mut sink.rcdom, url, &sink.features) { + (true, Some(extracted.content)) + } else { + (false, None) + } +} + +fn url_maybe_readable(url: &Url) -> bool { + let scheme = url.scheme(); + scheme == "http" || scheme == "https" +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_speedreader_streamer() { + let mut buf = vec![]; + let mut sreader = + SpeedReaderHeuristics::try_new("https://test.xyz", |c: &[u8]| buf.extend_from_slice(c)) + .unwrap(); + + let buff1 = "

hello".as_bytes(); + let buff2 = "world

\n\n\n\n

".as_bytes(); + let buff3 = "this is a link".as_bytes(); + + sreader.write(&buff1).ok(); + sreader.write(&buff2).ok(); + sreader.write(&buff3).ok(); + sreader.end().ok(); + let result_sink = sreader.streamer.end(); + + assert_eq!(result_sink.features["url_depth"], 1); + assert_eq!(result_sink.features["p"], 1); + assert_eq!(result_sink.features["a"], 1); + } +} diff --git a/components/speedreader/rust/lib/src/speedreader_streaming.rs b/components/speedreader/rust/lib/src/speedreader_streaming.rs new file mode 100644 index 000000000000..d823b12eb980 --- /dev/null +++ b/components/speedreader/rust/lib/src/speedreader_streaming.rs @@ -0,0 +1,56 @@ +use lol_html::doc_comments; +use lol_html::OutputSink; +use lol_html::Selector; +use lol_html::{HtmlRewriter, Settings}; +use url::Url; + +use super::rewriter_config_builder::{content_handlers, ContentFunction}; +use super::speedreader::*; + +pub struct SpeedReaderStreaming<'h, O> +where + O: OutputSink, +{ + url: Url, + rewriter: HtmlRewriter<'h, O>, +} + +impl<'h, O: OutputSink> SpeedReaderProcessor for SpeedReaderStreaming<'h, O> { + fn write(&mut self, chunk: &[u8]) -> Result<(), SpeedReaderError> { + self.rewriter.write(chunk)?; + Ok(()) + } + + fn end(&mut self) -> Result<(), SpeedReaderError> { + self.rewriter.end()?; + Ok(()) + } + + fn rewriter_type(&self) -> RewriterType { + RewriterType::Streaming + } +} + +impl<'h, O: OutputSink> SpeedReaderStreaming<'h, O> { + pub fn try_new( + url: Url, + output_sink: O, + config: &'h [(Selector, ContentFunction)], + ) -> Result { + let rewriter = HtmlRewriter::try_new( + Settings { + element_content_handlers: content_handlers(config), + document_content_handlers: vec![doc_comments!(|el| { + el.remove(); + Ok(()) + })], + ..Settings::default() + }, + output_sink, + )?; + + let sr = SpeedReaderStreaming { url, rewriter }; + + Ok(sr) + } +} diff --git a/components/speedreader/rust/lib/src/whitelist.rs b/components/speedreader/rust/lib/src/whitelist.rs new file mode 100644 index 000000000000..6be83699113b --- /dev/null +++ b/components/speedreader/rust/lib/src/whitelist.rs @@ -0,0 +1,164 @@ +use serde::{Deserialize, Serialize}; +use std::collections::HashMap; +use std::io::prelude::*; +use flate2::read::GzDecoder; + +use crate::speedreader::{SpeedReaderConfig, SpeedReaderError}; + +const IMAGE_TARGET_WIDTH: u32 = 600; + +#[derive(Serialize, Deserialize)] +pub struct Whitelist { + map: HashMap, +} + +impl Default for Whitelist { + fn default() -> Self { + Whitelist { + map: HashMap::new(), + } + } +} + +impl Whitelist { + pub fn add_configuration(&mut self, config: SpeedReaderConfig) { + self.map.insert(config.domain.clone(), config); + } + + pub fn get_configuration(&self, domain: &str) -> Option<&SpeedReaderConfig> { + if let Some(config) = self.map.get(domain) { + return Some(config); + } + + for (i, c) in domain[..domain.len() - 2].char_indices() { + if c == '.' { + let subdomain = &domain[i + 1..]; + let maybe_config = self.map.get(subdomain); + if maybe_config.is_some() { + return maybe_config; + } + } + } + + None + } + + pub fn get_url_rules(&self) -> Vec { + self.map + .values() + .flat_map(|c| c.url_rules.iter().cloned()) + .collect() + } + + pub fn serialize(&self) -> Result, SpeedReaderError> { + let mut out = Vec::new(); + let j = serde_json::to_string(&self.map.values().collect::>())?; + out.extend_from_slice(j.as_bytes()); + Ok(out) + } + + pub fn deserialize(serialized: &[u8]) -> Result { + let mut gz = GzDecoder::new(serialized); + let mut s = String::new(); + let read = gz.read_to_string(&mut s); + if read.is_err() { + let decoded = std::str::from_utf8(serialized)?; + s.clear(); + s.push_str(decoded); + } + let configurations: Vec = serde_json::from_str(&s)?; + let mut whitelist = Whitelist::default(); + for config in configurations.into_iter() { + whitelist.add_configuration(config) + } + Ok(whitelist) + } +} + +#[cfg(test)] +mod test { + use super::*; + + #[test] + pub fn default_whitelist_no_config() { + let whitelist = Whitelist::default(); + assert!(whitelist.map.is_empty()); + let config = whitelist.get_configuration("example.com"); + assert!(config.is_none()); + } + + #[test] + pub fn get_some_configuration() { + let mut whitelist = Whitelist::default(); + whitelist.add_configuration(SpeedReaderConfig { + domain: "example.com".to_owned(), + url_rules: vec![ + r#"||example.com/article"#.to_owned(), + r#"@@||example.com/article/video"#.to_owned(), + ], + declarative_rewrite: None, + }); + let config = whitelist.get_configuration("example.com"); + assert!(config.is_some()); + } + + #[test] + pub fn get_some_subdomain_configuration() { + let mut whitelist = Whitelist::default(); + whitelist.add_configuration(SpeedReaderConfig { + domain: "example.com".to_owned(), + url_rules: vec![ + r#"||example.com/article"#.to_owned(), + r#"@@||example.com/article/video"#.to_owned(), + ], + declarative_rewrite: None, + }); + let config = whitelist.get_configuration("www.example.com"); + assert!(config.is_some()); + } + + #[test] + pub fn url_rules_collected() { + let mut whitelist = Whitelist::default(); + whitelist.add_configuration(SpeedReaderConfig { + domain: "example.com".to_owned(), + url_rules: vec![ + r#"||example.com/article"#.to_owned(), + r#"@@||example.com/article/video"#.to_owned(), + ], + declarative_rewrite: None, + }); + whitelist.add_configuration(SpeedReaderConfig { + domain: "example.net".to_owned(), + url_rules: vec![r#"||example.net/article"#.to_owned()], + declarative_rewrite: None, + }); + let rules = whitelist.get_url_rules(); + assert_eq!(rules.len(), 3); + } + + #[test] + pub fn conflicting_insert_overrides() { + let mut whitelist = Whitelist::default(); + whitelist.add_configuration(SpeedReaderConfig { + domain: "example.com".to_owned(), + url_rules: vec![ + r#"||example.com/article"#.to_owned(), + r#"@@||example.com/article/video"#.to_owned(), + ], + declarative_rewrite: None, + }); + whitelist.add_configuration(SpeedReaderConfig { + domain: "example.com".to_owned(), + url_rules: vec![r#"||example.com/news"#.to_owned()], + declarative_rewrite: None, + }); + assert_eq!(whitelist.map.len(), 1); + let config = whitelist.get_configuration("example.com"); + assert!(config.is_some()); + assert_eq!( + config.unwrap().url_rules, + vec!["||example.com/news".to_owned()] + ); + } +} diff --git a/components/speedreader/rust/lib/tests/SpeedReaderConfig.dat b/components/speedreader/rust/lib/tests/SpeedReaderConfig.dat new file mode 100644 index 000000000000..e76f41cec5fc Binary files /dev/null and b/components/speedreader/rust/lib/tests/SpeedReaderConfig.dat differ diff --git a/components/speedreader/rust/lib/tests/SpeedReaderConfig.json b/components/speedreader/rust/lib/tests/SpeedReaderConfig.json new file mode 100644 index 000000000000..e87911f558e9 --- /dev/null +++ b/components/speedreader/rust/lib/tests/SpeedReaderConfig.json @@ -0,0 +1 @@ +[{"domain":"chron.com","url_rules":["||chron.com/*/article/"],"declarative_rewrite":{"main_content":[".article-title",".article-body"],"main_content_cleanup":[".hidden",".control-panel",".article-body > script",".caption-truncated"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[{"selector":"li.hst-resgalleryitem","element_name":"div"}]}},{"domain":"weather.com","url_rules":["||weather.com/*/news/*"],"declarative_rewrite":{"main_content":[".article-wrapper"],"main_content_cleanup":[],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}},{"domain":"businessinsider.com","url_rules":[],"declarative_rewrite":{"main_content":[".post-headline:nth",".byline-wrapper","#l-content",".container figure"],"main_content_cleanup":[".share-wrapper",".ad",".category-tagline",".popular-video","figure .lazy-image","figure .lazy-blur"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[{"selector":"figure noscript","attribute":null,"element_name":"div"}]}},{"domain":"sfgate.com","url_rules":["||sfgate.com/*/article/*"],"declarative_rewrite":{"main_content":[".article-content .article-title",".article-content .article-body"],"main_content_cleanup":[".asset_gallery .control-panel",".asset_media",".caption-truncated"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[{"selector":".hst-resgalleryitem","attribute":null,"element_name":"figure"},{"selector":".caption","attribute":null,"element_name":"figcaption"}]}},{"domain":"smh.com.au","url_rules":["/smh\\.com\\.au\\/.*\\/(\\w+-){3,}-(\\d{6})-(p\\d{3,})\\.html/"],"declarative_rewrite":{"main_content":["article"],"main_content_cleanup":[".noPrint"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}},{"domain":"variety.com","url_rules":["/variety\\.com\\/.*-(\\d){6,}/"],"declarative_rewrite":{"main_content":[".post"],"main_content_cleanup":[".c-author__extra","[data-trigger=share-links-manager]",".pmc-contextual-player","footer",".c-ad, .admz","[id^=comments]"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}},{"domain":"aljazeera.com","url_rules":["@@||aljazeera.com/news/*.html","@@||aljazeera.com/indepth/*.html"],"declarative_rewrite":{"main_content":[".article-heading",".main-article-body",".article-gallery-sec"],"main_content_cleanup":[".article-embedded-card",".article-readToMe-share-block",".article-heading-author-name img"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}},{"domain":"dw.com","url_rules":["||dw.com/*/a-*"],"declarative_rewrite":{"main_content":["#bodyContent"],"main_content_cleanup":["[class$=Teaser]",".video",".relatedContent",".smallList","#sharing-bar"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}},{"domain":"cnbc.com","url_rules":["/cnbc.com\\/(\\d){4}\\/(\\d){2}\\/(\\d){2}\\/.*.html/","||cnbc.com/select/*/"],"declarative_rewrite":{"main_content":["#main-article-header","[data-module=\"ArticleBody\"]"],"main_content_cleanup":[".InlineVideo-videoEmbed"],"delazify":false,"fix_embeds":false,"content_script":"","preprocess":[{"selector":"[id^=\"ArticleBody-InlineImage\"]","attribute":null,"element_name":"figure"},{"selector":"[id^=\"ArticleBody-InlineImage\"] .lazyload-placeholder","attribute":null,"element_name":"img"},{"selector":"[id^=\"ArticleBody-InlineImage\"] > div > div:not([class*=\"imagePlaceholder\"])","attribute":null,"element_name":"figcaption"}]}},{"domain":"nationalgeographic.com","url_rules":["/nationalgeographic\\.com\\/.*\\/(\\d){4}\\/(\\d){2}\\/.*/"],"declarative_rewrite":{"main_content":["article"],"main_content_cleanup":["#smart-body__read-more",".lead-container__social-wrap",".media__caption--mobile-expanded",".UniversalVideo",".enlarge-button"],"delazify":true,"fix_embeds":false,"content_script":"","preprocess":[{"selector":".placeholder-image-wrap .picturefill","attribute":null,"element_name":"img"}]}},{"domain":"latimes.com","url_rules":["||latimes.com/*/story/*"],"declarative_rewrite":{"main_content":[".ArticlePage-content",".LongFormPage-content"],"main_content_cleanup":[".NewsletterModule","[class*=Page-actions]","[class*=Page-contentFooter]","[class*=Page-aside]","[class*=Page-comments]",".RevContent",".SocialBar",".Enhancement > .Infobox"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}},{"domain":"theguardian.com","url_rules":["/theguardian.com\\/.*\\/(\\d){4}\\/\\w+\\/(\\d){2}\\/.*/"],"declarative_rewrite":{"main_content":["article header",".content__article-body"],"main_content_cleanup":[".hide-on-mobile",".inline-icon",".atom__button","input",".meta__extras",".content__headline-showcase-wrapper",".fc-container__header","figure.element-embed",".vjs-control-text"],"delazify":true,"fix_embeds":true,"content_script":"","preprocess":[{"selector":".vjs-big-play-button[style]","attribute":["style","data-src-background"],"element_name":"img"}]}},{"domain":"wsj.com","url_rules":["||www.wsj.com/articles/"],"declarative_rewrite":{"main_content":["article > main"],"main_content_cleanup":["#saving-united-coupon-list",".author-info"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}},{"domain":"cbsnews.com","url_rules":["||cbsnews.com/news/*","@@||cbsnews.com/live","@@||cbsnews.com/video"],"declarative_rewrite":{"main_content":["article.content","article.article"],"main_content_cleanup":[".sharebar",".content__cta","figure .embed__content--draggable","figure svg","script","[data-component=socialLinks]","[data-component=sharebar]"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[{"selector":"link[as=\"image\"]","attribute":["href","src"],"element_name":"img"}]}},{"domain":"time.com","url_rules":["/time.com\\/(\\d){6,}\\/.*/"],"declarative_rewrite":{"main_content":["main.article"],"main_content_cleanup":[".edit-link",".most-popular-feed",".inline-recirc",".newsletter-callout",".article-bottom",".article-small-sidebar",".ad",".component.video video:not([poster])"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[{"selector":"noscript","attribute":null,"element_name":"div"}]}},{"domain":"livemint.com","url_rules":["/livemint.com\\/.*-\\d{4,}\\.html/"],"declarative_rewrite":{"main_content":["article",".contentSec"],"main_content_cleanup":[".socialHolder",".adHolderStory","a.btnClose"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}},{"domain":"alarabiya.net","url_rules":["/alarabiya\\.net\\/(\\d){4}\\/(\\d){2}\\/(\\d){2}\\/.*/"],"declarative_rewrite":{"main_content":["article"],"main_content_cleanup":["article > img",".teaser-tools"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}},{"domain":"reddit.com","url_rules":["||reddit.com/r/*/comments/*"],"declarative_rewrite":{"main_content":[".Post",".Comment"],"main_content_cleanup":[".Post button",".Comment button",".Comment svg"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}},{"domain":"huffingtonpost.co.uk","url_rules":["||huffingtonpost.co.uk/entry/*"],"declarative_rewrite":{"main_content":[".entry__content",".entry__header"],"main_content_cleanup":[".share-bar",".ad_spot",".advertisement-label",".entry__content script",".top-media iframe","aside.rail",".cli-related-articles",".js-react-hydrator"],"delazify":true,"fix_embeds":false,"content_script":"","preprocess":[{"selector":".vdb_player[data-placeholder]","attribute":["data-placeholder","src"],"element_name":"img"},{"selector":".embed-asset div[style]","attribute":["style","data-style"],"element_name":"div"},{"selector":".embed-asset iframe[style]","attribute":["style","data-style"],"element_name":"iframe"}]}},{"domain":"euronews.com","url_rules":["/euronews\\.com\\/(\\d){4}\\/(\\d){2}\\/(\\d){2}\\/.*/"],"declarative_rewrite":{"main_content":["article"],"main_content_cleanup":["[class$=spotim]","article [class^=js-]",".teaser-tools","[class*=social]",".media__body__cartouche__mask",".c-font-size-switcher","footer",".c-article-meta__content-img",".ads"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}},{"domain":"washingtonpost.com","url_rules":["/washingtonpost.com\\/.*\\/(\\d){4}\\/(\\d){2}\\/(\\d){2}\\/\\w+/","||washingtonpost.com*_story.html","! travel pages currently handled poorly","@@||washingtonpost.com/travel"],"declarative_rewrite":{"main_content":["main > header","main > article .byline","main > article [data-qa=\"timestamp\"]","main > article figure",".article-body",".ent-article-body","[data-feature-name^=\"etv3\"]"],"main_content_cleanup":["header > nav",".tooltip","[data-qa=\"article-body-ad\"]"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[{"selector":"[data-fallback-image-url]","attribute":["data-fallback-image-url","src"],"element_name":"img"}]}},{"domain":"reuters.com","url_rules":["||reuters.com/article/*"],"declarative_rewrite":{"main_content":[".ArticleHeader_container",".StandardArticleBody_body"],"main_content_cleanup":[".SmallImage_small-image","[class$=expand-button]",".Slideshow_caption","[role=button]"],"delazify":true,"fix_embeds":false,"content_script":"","preprocess":[]}},{"domain":"foxnews.com","url_rules":["@@||video.foxnews.com","||foxnews.com/auto/*","||foxnews.com/entertainment/*","||foxnews.com/faith-values/*","||foxnews.com/food-drink/*","||foxnews.com/great-outdoors/*","||foxnews.com/health/*","||foxnews.com/lifestyle/*","||foxnews.com/media/*","||foxnews.com/opinion/*","||foxnews.com/politics/*","||foxnews.com/real-estate/*","||foxnews.com/science/*","||foxnews.com/sports/*","||foxnews.com/tech/*","||foxnews.com/travel/*","||foxnews.com/us/*","||foxnews.com/world/*"],"declarative_rewrite":{"main_content":["article"],"main_content_cleanup":[".sidebar",".article-social",".author-headshot"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}},{"domain":"cnn.com","url_rules":["/cnn.com\\/(\\d){4}\\/(\\d){2}\\/(\\d){2}\\/.*index.html/","||cnn.com/*/article/*/index.html"],"declarative_rewrite":{"main_content":[".pg-headline",".metadata",".media__video--thumbnail-wrapper img","[itemprop=\"articleBody\"]"],"main_content_cleanup":[".m-share",".pg-comments","[class*=\"outbrain\"]",".zn-story-bottom",".zn-body__read-more"],"delazify":true,"fix_embeds":true,"content_script":null,"preprocess":[]}},{"domain":"bbc.co.uk","url_rules":["/bbc\\.co.uk\\/.*-(\\d){6,}/","/bbc\\.co.uk\\/.*\\/.*\\/(\\d){6,}/","||bbc.co.uk/*/articles/*","@@||bbc.co.uk/*/live/*"],"declarative_rewrite":{"main_content":[".story-headline, .story-info, .story-body","#story-page","section.article",".programmes-page.article--individual","article.blocks-article"],"main_content_cleanup":["[class*=share-tools]",".idt2",".off-screen","#share-tools-top",".story-share",".article__footer","article header img",".drop-capped"],"delazify":true,"fix_embeds":true,"content_script":"","preprocess":[{"selector":".js-delayed-image-load","attribute":null,"element_name":"img"},{"selector":"a.replace-image","attribute":["href","src"],"element_name":"img"},{"selector":".blocks-image","attribute":null,"element_name":"img"}]}},{"domain":"bbc.com","url_rules":["/bbc\\.com\\/.*-(\\d){6,}/","/bbc\\.com\\/.*\\/.*\\/(\\d){6,}/","||bbc.com/*/articles/*","@@||bbc.com/*/live/*"],"declarative_rewrite":{"main_content":[".story-headline, .story-info, .story-body","#story-page","section.article",".programmes-page.article--individual","article.blocks-article"],"main_content_cleanup":["[class*=share-tools]",".idt2",".off-screen","#share-tools-top",".story-share",".article__footer","article header img",".drop-capped"],"delazify":true,"fix_embeds":true,"content_script":"","preprocess":[{"selector":".js-delayed-image-load","attribute":null,"element_name":"img"},{"selector":"a.replace-image","attribute":["href","src"],"element_name":"img"},{"selector":".blocks-image","attribute":null,"element_name":"img"}]}},{"domain":"usatoday.com","url_rules":["||usatoday.com/story/*"],"declarative_rewrite":{"main_content":["article",".article-wrapper"],"main_content_cleanup":[".gnt_ss","svg","custom-style"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[{"selector":"button[data-c-vpattrs]","attribute":["id","id"],"element_name":"div"},{"selector":"slide","attribute":["original","src"],"element_name":"img"}]}},{"domain":"chicagotribune.com","url_rules":["@@||chicagotribune.com/*-story.html"],"declarative_rewrite":{"main_content":["article"],"main_content_cleanup":[".sharebar","[data-type=recommender]"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}},{"domain":"dailycaller.com","url_rules":["/dailycaller\\.com\\/(\\d){4}\\/(\\d){2}\\/(\\d){2}\\/.*/"],"declarative_rewrite":{"main_content":["article header","article .article-content"],"main_content_cleanup":["header button","footer"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}},{"domain":"theonion.com","url_rules":["/theonion\\.com\\/.*-(\\d){6,}/"],"declarative_rewrite":{"main_content":[".js_post-content","div header"],"main_content_cleanup":[".js_share-tools",".post-tools-wrapper",".js_tag-dropdown",".magnifier"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}},{"domain":"nytimes.com","url_rules":["/www.nytimes.com\\/\\d{4}\\/\\d{2}\\/\\d{2}\\/([^\\/]+(\\/)?){2,3}\\.html/"],"declarative_rewrite":{"main_content":["div.g-blocks","section[name=\"articleBody\"]","article header"],"main_content_cleanup":[".ad","header#story-header",".story-body-1 .lede.video",".visually-hidden","#newsletter-promo",".promo",".comments-button",".hidden",".comments",".supplemental",".nocontent",".story-footer-links","#sponsor-wrapper","[role=\"toolbar\"]","header > section"],"delazify":true,"fix_embeds":true,"content_script":"\n \n ","preprocess":[]}},{"domain":"247sports.com","url_rules":["||247sports.com/Article/"],"declarative_rewrite":{"main_content":["section .article-cnt"],"main_content_cleanup":[".article-cnt__header > .container"],"delazify":true,"fix_embeds":true,"content_script":null,"preprocess":[]}},{"domain":"forbes.com","url_rules":["/forbes.com\\/sites\\/\\w+\\/(\\d){4}\\/(\\d){2}\\/(\\d){2}\\/\\w+/"],"declarative_rewrite":{"main_content":["article > main",".body-container"],"main_content_cleanup":[".article-footer",".disqus-module",".article-sharing","sharing",".fs-author-avatar",".fs-icon",".contrib-bio button",".contrib-bio .contributor-about__initial-description","fbs-ad","#speechkit-io-iframe"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}},{"domain":"nbcnews.com","url_rules":["||nbcnews.com/*-n*","@@||nbcnews.com/video"],"declarative_rewrite":{"main_content":[".article header",".article article",".article figure"],"main_content_cleanup":[".article article svg","[data-test=newsletter-signup]","#emailSignup",".ad-container"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}},{"domain":"thedailybeast.com","url_rules":["@@||thedailybeast.com/category/","/thedailybeast\\.com\\/(\\w+-)+/"],"declarative_rewrite":{"main_content":["article.Story","body > div > script:not([src]):not([type])"],"main_content_cleanup":[".StandardHeader__share-buttons",".StoryFooter",".PullQuote__logo-icon",".PullQuote__top-line",".PullQuote__big-quote","figure svg",".SimpleAd",".Byline__photo-link"],"delazify":true,"fix_embeds":false,"content_script":"","preprocess":[{"selector":".PullQuote","attribute":null,"element_name":"blockquote"}]}},{"domain":"newsweek.com","url_rules":["/newsweek\\.com\\/.*(\\d){6,}/"],"declarative_rewrite":{"main_content":["article",".article-header","figure"],"main_content_cleanup":[".social-share","article .block-nw-magazine",".hidden-print"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}},{"domain":"bloomberg.com","url_rules":["||bloomberg.com/*/articles/*","||bloomberg.com/*/features/*"],"declarative_rewrite":{"main_content":[".article-content",".feature-article"],"main_content_cleanup":[".right-rail",".article-newsfeed",".gateway-mobile-lede-text",".video-player__overlay",".left-column",".share-article-button",".text-to-speech",".first-paragraph-image"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}},{"domain":"huffpost.com","url_rules":["||huffpost.com/entry/*"],"declarative_rewrite":{"main_content":[".entry__content",".entry__header"],"main_content_cleanup":[".share-bar",".ad_spot",".advertisement-label",".entry__content script",".top-media iframe","aside.rail",".cli-related-articles",".js-react-hydrator"],"delazify":true,"fix_embeds":false,"content_script":"","preprocess":[{"selector":".vdb_player[data-placeholder]","attribute":["data-placeholder","src"],"element_name":"img"},{"selector":".embed-asset div[style]","attribute":["style","data-style"],"element_name":"div"},{"selector":".embed-asset iframe[style]","attribute":["style","data-style"],"element_name":"iframe"}]}},{"domain":"nypost.com","url_rules":["/nypost.com\\/(\\d){4}\\/(\\d){2}\\/(\\d){2}\\/.*/"],"declarative_rewrite":{"main_content":[".article-header",".slide"],"main_content_cleanup":[".no-mobile",".author-contact",".sharedaddy",".author-flyout"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}},{"domain":"abcnews.go.com","url_rules":["||abcnews.go.com/*/story","||abcnews.go.com/*/wireStory"],"declarative_rewrite":{"main_content":[".Article__Wrapper","body > script:not([src])"],"main_content_cleanup":[".CalloutLink",".Article__Footer",".Article__Header .Share",".MediaPlaceholder__Overlay",".inlineElement > iframe",".Screen__Reader__Text",".taboola"],"delazify":true,"fix_embeds":true,"content_script":"","preprocess":[]}},{"domain":"usnews.com","url_rules":["||usnews.com/*/articles/*"],"declarative_rewrite":{"main_content":[".content",".feature-article"],"main_content_cleanup":[".right-rail",".article-newsfeed",".flex",".sticky-heading","svg[class^=Credit]","button","[class*=-hide]","[class*=Hide-]","[class*=LoadMore]"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}},{"domain":"thehill.com","url_rules":["/thehill\\.com\\/[\\w-]+\\/[\\w-]+\\/(\\d){3}-.*/"],"declarative_rewrite":{"main_content":[".content-wrapper.title",".title-wrapper .title","article"],"main_content_cleanup":[".dfp-tag-wrapper",".rollover-block","#jwplayer-unmute-button"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}},{"domain":"cnet.com","url_rules":["||cnet.com/features/*","||cnet.com/roadshow/reviews/*","||cnet.com/roadshow/news/*","||cnet.com/news/*","||cnet.com/reviews/*","||cnet.com/how-to/*"],"declarative_rewrite":{"main_content":[".article-main-body",".hero-content"],"main_content_cleanup":["footer","noscript",".c-head_bottomWrapper",".c-head_share",".social-button-small-author",".clickToEnlarge",".gallery",".video",".svg-symbol"],"delazify":true,"fix_embeds":true,"content_script":null,"preprocess":[]}},{"domain":"hollywoodreporter.com","url_rules":["/hollywoodreporter\\.com\\/.*-(\\d){6,}/"],"declarative_rewrite":{"main_content":["article",".blog-post"],"main_content_cleanup":[".social-share",".dfp-ad",".blog-post aside",".blog-post-sections"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}},{"domain":"theatlantic.com","url_rules":["/theatlantic.com\\/.*\\/(\\d){4}\\/(\\d){2}\\/.*\\/\\d{4,}/"],"declarative_rewrite":{"main_content":["article"],"main_content_cleanup":[".c-share-social","header .c-article-author__image",".c-article-writer__social-link-icon",".ad-boxinjector-wrapper",".ad"],"delazify":true,"fix_embeds":false,"content_script":null,"preprocess":[]}}] \ No newline at end of file diff --git a/components/speedreader/rust/lib/tests/legacy.rs b/components/speedreader/rust/lib/tests/legacy.rs new file mode 100644 index 000000000000..62b96b0768c6 --- /dev/null +++ b/components/speedreader/rust/lib/tests/legacy.rs @@ -0,0 +1,375 @@ +#![allow(dead_code)] +extern crate distance; +extern crate html5ever; +extern crate readability; +extern crate regex; +extern crate speedreader; +extern crate url; + +#[macro_use] +extern crate markup5ever; + +#[macro_use] +extern crate lazy_static; + +use readability::extractor; +use speedreader::classifier::feature_extractor::FeatureExtractorStreamer; +use std::collections::HashSet; +use std::fs::File; +use std::io::Read; +use url::Url; + +use markup5ever_rcdom::NodeData::{Element, Text}; +use markup5ever_rcdom::RcDom; +use markup5ever_rcdom::{Handle, Node}; +use regex::Regex; +use std::rc::Rc; +use std::vec::Vec; + +static SAMPLES_PATH: &str = "data/tests-samples/"; + +fn load_test_files(test_name: &str) -> String { + let mut expected = String::new(); + let mut exp_f = File::open(format!("{}/{}/expected.html", SAMPLES_PATH, test_name)).unwrap(); + exp_f.read_to_string(&mut expected).unwrap(); + expected +} + +pub fn extract_flattened_tree( + handle: Handle, + tags_extracted: &HashSet, + flattened_nodes: &mut Vec>, +) -> Vec> { + for child in handle.children.borrow().iter() { + let c = child.clone(); + match c.data { + Text { .. } => { + flattened_nodes.push(c.clone()); + } + Element { ref name, .. } => { + let tag = name.local.as_ref(); + let tag_name = tag.to_lowercase(); + + if tags_extracted.contains(&tag_name) { + flattened_nodes.push(c.clone()); + } + + // if type Element, traverse to children in next iteration + extract_flattened_tree(child.clone(), tags_extracted, flattened_nodes); + } + _ => (), + } + } + flattened_nodes.to_vec() +} + +pub fn extract_text(handle: &Handle) -> String { + let node_text = match handle.data { + Text { ref contents } => Some(contents.borrow().trim().to_string()), + Element { + ref name, + ref attrs, + .. + } if name.local == local_name!("img") => { + let attrs_borrow = attrs.borrow(); + let attr = attrs_borrow + .iter() + .find(|attr| attr.name.local == local_name!("src")); + let attr_value: Option = attr.map(|a| a.value.to_string()); + Some(format!("", attr_value)) + } + Element { + ref name, + ref attrs, + .. + } if name.local == local_name!("a") => { + let attrs_borrow = attrs.borrow(); + let attr = attrs_borrow + .iter() + .find(|attr| attr.name.local == local_name!("href")); + let attr_value: Option = attr.map(|a| a.value.to_string()); + Some(format!("", attr_value)) + } + _ => None, + }; + + let contents = if let Some(text) = node_text { + vec![text] + } else { + vec![] + }; + contents.join(" ") +} + +fn lcs(left: &[String], right: &[String]) -> (usize, Vec) { + let total_rows = left.len() + 1; + let total_columns = right.len() + 1; + let mut table = vec![vec![0; total_columns]; total_rows]; + for (row, left_text) in left.iter().enumerate() { + for (col, right_text) in right.iter().enumerate() { + if left_text == right_text { + table[row + 1][col + 1] = table[row][col] + 1; + } else { + table[row + 1][col + 1] = std::cmp::max(table[row + 1][col], table[row][col + 1]); + } + } + } + let mut common_seq = Vec::new(); + let mut x = total_rows - 1; + let mut y = total_columns - 1; + while x != 0 && y != 0 { + // Check element above is equal + if table[x][y] == table[x - 1][y] { + x -= 1; + } + // check element to the left is equal + else if table[x][y] == table[x][y - 1] { + y -= 1; + } else { + // check the two element at the respective x,y position is same + assert_eq!(left[x - 1], right[y - 1]); + let text = left[x - 1].to_owned(); + common_seq.push(text); + x -= 1; + y -= 1; + } + } + common_seq.reverse(); + (table[total_rows - 1][total_columns - 1], common_seq) +} + +fn get_flat_dom_nodes(dom: &RcDom) -> Vec { + let mut expected_nodes = Vec::new(); + // checks full flattened tree for a subset of (tags, attrs) + let mut tags = HashSet::new(); + // #TODO: check a tags and imgs too, but for now focus on text + tags.insert("a".to_owned()); + //tags.insert("img".to_owned()); + extract_flattened_tree(dom.document.clone(), &tags, &mut expected_nodes); + + lazy_static! { + static ref WHITESPACE: Regex = Regex::new(r"(\s\s+)").unwrap(); + static ref NEWLINE_ESCAPED: Regex = Regex::new(r"(\\n)").unwrap(); + } + + expected_nodes + .iter() + .map(|n| extract_text(n)) + .map(|t| { + let repl = NEWLINE_ESCAPED.replace_all(&t, " "); + let repl = WHITESPACE.replace_all(&repl, " "); + format!("{}", repl) + }) + .filter(|t| !t.is_empty()) + .collect() +} + +fn generate_comparison(left: &[String], right: &[String], lcs: &[String]) -> String { + let mut left_iter = left.iter(); + let mut right_iter = right.iter(); + let mut output = "\n".to_owned(); + for common in lcs { + while let Some(left) = left_iter.next() { + if left == common { + break; + } else { + output.push_str(&format!( + "{} {} {}\n", + termion::color::Fg(termion::color::Red), + left, + termion::color::Fg(termion::color::Reset) + )); + } + } + + while let Some(right) = right_iter.next() { + if right == common { + break; + } else { + output.push_str(&format!( + "{} {} {}\n", + termion::color::Fg(termion::color::Yellow), + right, + termion::color::Fg(termion::color::Reset) + )); + } + } + + output.push_str(&format!( + "{} {} {}\n", + termion::color::Fg(termion::color::Reset), + common, + termion::color::Fg(termion::color::Reset) + )); + } + + for left in left_iter { + output.push_str(&format!( + "{} {} {}\n", + termion::color::Fg(termion::color::Red), + left, + termion::color::Fg(termion::color::Reset) + )); + } + + for right in right_iter { + output.push_str(&format!( + "{} {} {}\n", + termion::color::Fg(termion::color::Yellow), + right, + termion::color::Fg(termion::color::Reset) + )); + } + output +} + +fn test_contents(name: &str) { + let url = Url::parse("http://url.com").unwrap(); + let mut source_f = File::open(format!("{}/{}/source.html", SAMPLES_PATH, name)).unwrap(); + + // opens and parses the expected final result into a rcdom + // (for comparing with the result) + let expected_string = load_test_files(stringify!($name)); + let mut feature_extractor = FeatureExtractorStreamer::try_new(&url).unwrap(); + feature_extractor + .write(&mut expected_string.as_bytes()) + .unwrap(); + let expected = feature_extractor.end(); + + let expected_nodes_str = get_flat_dom_nodes(&expected.rcdom); + + // uses the mapper build the mapper based on the source HTML + // document + let product = extractor::extract(&mut source_f, &url).unwrap(); + let mut feature_extractor = FeatureExtractorStreamer::try_new(&url).unwrap(); + feature_extractor + .write(&mut product.content.as_bytes()) + .unwrap(); + let result = feature_extractor.end(); + + let got_nodes_str = get_flat_dom_nodes(&result.rcdom); + + let (_, subsequence) = lcs(&expected_nodes_str, &got_nodes_str); + + assert!( + expected_nodes_str == got_nodes_str, + "Not equal: {}", + generate_comparison(&expected_nodes_str, &got_nodes_str, &subsequence) + ); +} + +// macro_rules! test_str { +// ($name:ident) => { +// #[test] +// fn $name() { +// test_contents(stringify!($name)) +// } +// } +// } + +// // - salon_1 has whole front of an article missing +// test_str!(salon_1); + +// // - wapo_2 doesn’t include key article images +// test_str!(wapo_2); + +// // - telegraph misses half an article +// test_str!(telegraph); + +// // - medium_3 misses multiple apragraphs at front _and_ end +// test_str!(medium_3); + +// // - nytimes_2 misses entire front including image and paragraphs +// test_str!(nytimes_2); + +// // - nytimes_4, nytimes_3 misses most of the article +// test_str!(nytimes_4); + +// // - mozilla_1 misses most of article +// test_str!(mozilla_1); + +// // - ehow_2 misses most of article +// test_str!(ehow_2); + +// test_str!(ars_1); +// test_str!(cnet); +// test_str!(folha); +// test_str!(liberation_1); +// test_str!(metadata_content_missing); +// test_str!(msn); +// test_str!(rtl_1); +// test_str!(rtl_2); +// test_str!(rtl_3); +// test_str!(rtl_4); +// test_str!(tumblr); +// test_str!(yahoo_4); +// test_str!(videos_2); +// test_str!(pixnet); +// test_str!(aclu); +// test_str!(base_url); +// test_str!(base_url_base_element); +// test_str!(base_url_base_element_relative); +// test_str!(basic_tags_cleaning); +// test_str!(guardian_1); +// test_str!(heise); +// test_str!(embedded_videos); +// test_str!(lemonde_1); +// test_str!(lifehacker_post_comment_load); +// test_str!(lifehacker_working); +// test_str!(youth); +// test_str!(social_buttons); +// test_str!(style_tags_removal); +// test_str!(normalize_spaces); +// test_str!(nytimes_1); +// test_str!(missing_paragraphs); +// test_str!(replace_font_tags); +// test_str!(reordering_paragraphs); +// test_str!(videos_1); +// test_str!(breitbart); + +// test_str!(bbc_1); + +// test_str!(wordpress); +// test_str!(bug_1255978); +// test_str!(buzzfeed_1); +// test_str!(citylab_1); +// test_str!(clean_links); +// test_str!(cnet_svg_classes); +// test_str!(cnn); +// test_str!(comment_inside_script_parsing); +// test_str!(daringfireball_1); +// test_str!(ehow_1); +// test_str!(engadget); +// test_str!(gmw); +// test_str!(herald_sun_1); +// test_str!(hidden_nodes); +// test_str!(hukumusume); +// test_str!(iab_1); +// test_str!(ietf_1); +// test_str!(keep_images); +// test_str!(keep_tabular_data); +// test_str!(la_nacion); +// test_str!(links_in_tables); +// test_str!(lwn_1); +// test_str!(medicalnewstoday); +// test_str!(medium_1); +// test_str!(mercurial); +// test_str!(mozilla_2); +// test_str!(nytimes_3); +// test_str!(qq); +// test_str!(remove_extra_brs); +// test_str!(remove_extra_paragraphs); +// test_str!(remove_script_tags); +// test_str!(replace_brs); +// test_str!(seattletimes_1); +// test_str!(simplyfound_3); +// test_str!(svg_parsing); +// test_str!(table_style_attributes); +// test_str!(tmz_1); +// test_str!(wapo_1); +// test_str!(webmd_1); +// test_str!(webmd_2); +// test_str!(wikipedia); +// test_str!(yahoo_1); +// test_str!(yahoo_2); +// test_str!(yahoo_3); diff --git a/components/speedreader/rust/lib/tests/lib.rs b/components/speedreader/rust/lib/tests/lib.rs new file mode 100644 index 000000000000..ffdb946c49ba --- /dev/null +++ b/components/speedreader/rust/lib/tests/lib.rs @@ -0,0 +1,361 @@ +#![allow(dead_code)] +extern crate distance; +extern crate html5ever; +extern crate readability; +extern crate speedreader; +extern crate url; + +use readability::extractor::extract; +use speedreader::classifier::feature_extractor::FeatureExtractorStreamer; +use std::fs::File; +use std::io::Read; +use url::Url; + +use distance::damerau_levenshtein; +use markup5ever_rcdom::NodeData::{Element, Text}; +use markup5ever_rcdom::{Handle, Node}; +use std::rc::Rc; +use std::vec::Vec; + +static SAMPLES_PATH: &str = "data/tests-samples/"; + +pub fn extract_flattened_tree( + handle: Handle, + tags_attrs: Vec<(&str, &str)>, + flattened_nodes: &mut Vec>, +) -> Vec> { + for child in handle.children.borrow().iter() { + let c = child.clone(); + match c.data { + Text { .. } => { + flattened_nodes.push(c.clone()); + } + Element { + ref name, + ref attrs, + .. + } => { + let t = name.local.as_ref(); + for a in attrs.borrow().iter() { + let t = t.to_lowercase(); + let a = a.value.to_string().to_lowercase(); + + // check if current node name and attr match expected + for ta in tags_attrs.clone() { + let (tag_name, attr_name): (&str, &str) = ta; + if t == tag_name && a == attr_name { + flattened_nodes.push(c.clone()); + } + } + } + // if type Element, traverse to children in next iteration + extract_flattened_tree(child.clone(), tags_attrs.clone(), flattened_nodes); + } + _ => (), + } + } + flattened_nodes.to_vec() +} + +// recursively extracts all text of leaf nodes into a string for comparison +pub fn extract_text(handle: Handle, text: &mut String) { + for child in handle.children.borrow().iter() { + let c = child.clone(); + match c.data { + Text { ref contents } => { + text.push_str(contents.borrow().trim()); + } + Element { .. } => { + extract_text(child.clone(), text); + } + _ => (), + } + } +} + +// recursively collects values of nodes with a certain tuple (tag_id, attribute_id) +// into a vector of strings for comparison +fn stripped_content( + handle: Handle, + tag_name: &str, + attr_name: &str, + nodes: &mut Vec>, + values: &mut Vec, +) { + for child in handle.children.borrow().iter() { + if let Element { + ref name, + ref attrs, + .. + } = child.data + { + let t = name.local.as_ref(); + if t.to_lowercase() == tag_name { + nodes.push(child.clone()); + + for attr in attrs.borrow().iter() { + if attr.name.local.as_ref() == attr_name { + values.push(attr.value.to_string()); + } + } + }; + stripped_content(child.clone(), tag_name, attr_name, nodes, values); + } + } +} + +// compares if DOMs keep an approximate (to a factor) number and value of the tuple +// (tag_name, attr_name) +fn tags_match_approx( + d1: Handle, + d2: Handle, + tag_name: &str, + attr_name: &str, + approx_factor: usize, +) -> bool { + let mut values_d1 = Vec::new(); + let mut values_d2 = Vec::new(); + stripped_content(d1, tag_name, attr_name, &mut Vec::new(), &mut values_d1); + stripped_content(d2, tag_name, attr_name, &mut Vec::new(), &mut values_d2); + + if values_d2.len() > values_d1.len() + approx_factor { + println!("{:#?}\n != \n{:#?}", values_d1.len(), values_d2.len()); + return false; + } + + values_d1.sort(); + values_d2.sort(); + + let mut approx_counter = approx_factor; + for (i, _) in values_d1.clone().iter().enumerate() { + if values_d2.len() > i && values_d1[i] != values_d2[i] { + approx_counter -= 1; + if approx_counter == 0 { + return false; + } + } + } + true +} + +// stricly compares if flattened tree with subset of (tags, attrs) match +fn flattened_tree_match_strict(d1: Handle, d2: Handle, tags_attrs: Vec<(&str, &str)>) -> bool { + let _ftree1 = extract_flattened_tree(d1, tags_attrs.clone(), &mut Vec::new()); + let _ftree2 = extract_flattened_tree(d2, tags_attrs, &mut Vec::new()); + + // #TODO: compare nodes' content + //for (i, _) in ftree1.clone().iter().enumerate() { + // if ftree1[i] != ftree2[i] { + // return false; + //} + + true +} + +fn strings_match_approx(s1: &str, s2: &str, f: usize) -> bool { + let diff = damerau_levenshtein(s1, s2); + if diff > f { + println!("damerau_levenshtein:: {}", diff); + return false; + } + true +} + +fn load_test_files(test_name: &str) -> String { + let mut expected = "".to_owned(); + let mut exp_f = File::open(format!("{}/{}/expected.html", SAMPLES_PATH, test_name)).unwrap(); + exp_f.read_to_string(&mut expected).unwrap(); + + expected +} + +#[macro_use] +#[cfg(test)] +mod test { + macro_rules! test { + ($name:ident) => { + #[test] + fn $name() { + let url = Url::parse("http://url.com").unwrap(); + let mut source_f = File::open(format!( + "{}/{}/source.html", + SAMPLES_PATH, + stringify!($name) + )) + .unwrap(); + + // opens and parses the expected final result into a rcdom + // (for comparing with the result) + let expected_string = load_test_files(stringify!($name)); + let mut feature_extractor = FeatureExtractorStreamer::try_new(&url).unwrap(); + feature_extractor + .write(&mut expected_string.as_bytes()) + .unwrap(); + let expected = feature_extractor.end(); + + // uses the mapper build the mapper based on the source HTML + // document + let product = extract(&mut source_f, &url).unwrap(); + let mut feature_extractor = FeatureExtractorStreamer::try_new(&url).unwrap(); + feature_extractor + .write(&mut product.content.as_bytes()) + .unwrap(); + let result = feature_extractor.end(); + + // checks full flattened tree for a subset of (tags, attrs) + //let mut tags_attrs: Vec<(&str, &str)> = Vec::new(); + //tags_attrs.push(("a", "href")); + //tags_attrs.push(("img", "src")); + + //let flattened_tree_match = flattened_tree_match_strict( + // expected.dom.document.clone(), + // result.dom.document.clone(), + // tags_attrs); + + //assert!(flattened_tree_match, "Full flattened trees do not strictly match"); + + let atags_match = tags_match_approx( + expected.rcdom.document.clone(), + result.rcdom.document.clone(), + "a", + "href", + 5, + ); + + assert!( + atags_match, + "Node values of do not approximately match" + ); + + let imgtags_match = tags_match_approx( + expected.rcdom.document.clone(), + result.rcdom.document.clone(), + "img", + "src", + 5, + ); + + assert!( + imgtags_match, + "Node values of do not strictly match" + ); + + // note: now we can define tests similar to tags_match_strict + // but that are less strict. e.g. number of nodes in dom of a + // certain (tag, attr) may be differ by x) + + // compares full flattened text nodes + let levenstein_threshold = 900; + let mut text_result = String::new(); + extract_text(result.rcdom.document.clone(), &mut text_result); + let mut text_expected = String::new(); + extract_text(expected.rcdom.document.clone(), &mut text_expected); + + let strings_approx = + strings_match_approx(&text_result, &text_expected, levenstein_threshold); + assert!(strings_approx, "Flattened text is not similar enough"); + //assert_eq!(text_result, text_expected, "Falttened texts in p tags do not match"); + } + }; + } +} + +// passing + +#[cfg(test)] +mod fulltest { + use super::*; + test!(ars_1); + test!(cnet); + test!(folha); + test!(liberation_1); +} +// test!(metadata_content_missing); +// test!(msn); +// test!(rtl_1); +// test!(rtl_2); +// test!(rtl_3); +// test!(rtl_4); +// test!(title_and_h1_discrepancy); +// test!(tumblr); +// test!(yahoo_4); +// test!(videos_2); +// test!(wordpress); +// test!(pixnet); + +// // not passing in strict mode + +// test!(aclu); +// test!(base_url); +// test!(base_url_base_element); +// test!(base_url_base_element_relative); +// test!(basic_tags_cleaning); +// test!(bbc_1); +// test!(blogger); +// test!(breitbart); +// test!(bug_1255978); +// test!(buzzfeed_1); +// test!(citylab_1); +// test!(clean_links); +// test!(cnet_svg_classes); +// test!(cnn); +// test!(comment_inside_script_parsing); +// test!(daringfireball_1); +// test!(ehow_1); +// test!(ehow_2); +// test!(embedded_videos); +// test!(engadget); +// test!(gmw); +// test!(guardian_1); +// test!(heise); +// test!(herald_sun_1); +// test!(hidden_nodes); +// test!(hukumusume); +// test!(iab_1); +// test!(ietf_1); +// test!(keep_images); +// test!(keep_tabular_data); +// test!(la_nacion); +// test!(lemonde_1); +// test!(lifehacker_post_comment_load); +// test!(lifehacker_working); +// test!(links_in_tables); +// test!(lwn_1); +// test!(medicalnewstoday); +// test!(medium_1); +// test!(medium_3); +// test!(mercurial); +// test!(missing_paragraphs); +// test!(mozilla_1); +// test!(mozilla_2); +// test!(normalize_spaces); +// test!(nytimes_1); +// test!(nytimes_2); +// test!(nytimes_3); +// test!(nytimes_4); +// test!(qq); +// test!(remove_extra_brs); +// test!(remove_extra_paragraphs); +// test!(remove_script_tags); +// test!(reordering_paragraphs); +// test!(replace_brs); +// test!(replace_font_tags); +// test!(salon_1); +// test!(seattletimes_1); +// test!(simplyfound_3); +// test!(social_buttons); +// test!(style_tags_removal); +// test!(svg_parsing); +// test!(table_style_attributes); +// test!(telegraph); +// test!(tmz_1); +// test!(videos_1); +// test!(wapo_1); +// test!(wapo_2); +// test!(webmd_1); +// test!(webmd_2); +// test!(wikipedia); +// test!(yahoo_1); +// test!(yahoo_2); +// test!(yahoo_3); +// test!(youth); diff --git a/components/speedreader/rust/lib/tests/whitelist.rs b/components/speedreader/rust/lib/tests/whitelist.rs new file mode 100644 index 000000000000..1903e223f4cb --- /dev/null +++ b/components/speedreader/rust/lib/tests/whitelist.rs @@ -0,0 +1,42 @@ +extern crate speedreader; + +use std::fs; + +#[test] +fn serialization_works() { + let mut whitelist = speedreader::whitelist::Whitelist::default(); + whitelist.add_configuration(speedreader::SpeedReaderConfig { + domain: "example.com".to_owned(), + url_rules: vec![ + "||example.com/news/*".to_owned(), + ], + declarative_rewrite: None, + }); + let serialized = whitelist.serialize(); + assert!(serialized.is_ok()); + let serialized = serialized.unwrap(); + assert!(!serialized.is_empty()); + + let new_list = speedreader::whitelist::Whitelist::deserialize(&serialized); + assert!(new_list.is_ok()); + let new_list = new_list.unwrap(); + assert!(new_list.get_configuration("example.com").is_some()); +} + +#[test] +fn deserialize_stable_format() { + let serialized = fs::read("./tests/SpeedReaderConfig.dat").unwrap(); + let maybe_whitelist = speedreader::whitelist::Whitelist::deserialize(&serialized); + assert!(maybe_whitelist.is_ok()); + let whitelist = maybe_whitelist.unwrap(); + assert!(whitelist.get_configuration("cnn.com").is_some()); +} + +#[test] +fn deserialize_uncompressed() { + let serialized = fs::read("./tests/SpeedReaderConfig.json").unwrap(); + let maybe_whitelist = speedreader::whitelist::Whitelist::deserialize(&serialized); + assert!(maybe_whitelist.is_ok(), "Deserialization errored: {:?}", maybe_whitelist.err()); + let whitelist = maybe_whitelist.unwrap(); + assert!(whitelist.get_configuration("cnn.com").is_some()); +} diff --git a/components/speedreader/speedreader_service.cc b/components/speedreader/speedreader_service.cc index cfd2c2c70d55..7ba7f10dbf0b 100644 --- a/components/speedreader/speedreader_service.cc +++ b/components/speedreader/speedreader_service.cc @@ -6,15 +6,14 @@ #include "brave/components/speedreader/speedreader_service.h" #include "base/command_line.h" -#include "components/prefs/pref_registry_simple.h" -#include "components/prefs/pref_service.h" #include "brave/components/speedreader/speedreader_pref_names.h" #include "brave/components/speedreader/speedreader_switches.h" +#include "components/prefs/pref_registry_simple.h" +#include "components/prefs/pref_service.h" namespace speedreader { -SpeedreaderService::SpeedreaderService(PrefService* prefs) : prefs_(prefs) { -} +SpeedreaderService::SpeedreaderService(PrefService* prefs) : prefs_(prefs) {} SpeedreaderService::~SpeedreaderService() {} @@ -37,5 +36,4 @@ bool SpeedreaderService::IsEnabled() { return prefs_->GetBoolean(kSpeedreaderEnabled); } - } // namespace speedreader diff --git a/components/speedreader/speedreader_switches.h b/components/speedreader/speedreader_switches.h index 875897a48d38..be0054c9e70c 100644 --- a/components/speedreader/speedreader_switches.h +++ b/components/speedreader/speedreader_switches.h @@ -10,6 +10,7 @@ namespace speedreader { constexpr char kEnableSpeedreader[] = "enable-speedreader"; constexpr char kSpeedreaderWhitelist[] = "speedreader-whitelist"; +constexpr char kSpeedreaderWhitelistPath[] = "speedreader-whitelist-path"; } diff --git a/components/speedreader/speedreader_test_whitelist.cc b/components/speedreader/speedreader_test_whitelist.cc index d09af4d415ba..ced717093fca 100644 --- a/components/speedreader/speedreader_test_whitelist.cc +++ b/components/speedreader/speedreader_test_whitelist.cc @@ -33,8 +33,8 @@ std::vector GetHardcodedWhitelist() { bool IsWhitelistedForTest(const GURL& url) { const auto* cmd_line = base::CommandLine::ForCurrentProcess(); if (!cmd_line->HasSwitch(kSpeedreaderWhitelist)) { - // Everything whitelisted. - return true; + // Nothing whitelisted. + return false; } const std::string whitelist_str = cmd_line->GetSwitchValueASCII(kSpeedreaderWhitelist); diff --git a/components/speedreader/speedreader_throttle.cc b/components/speedreader/speedreader_throttle.cc index 6ac3286cf1b7..51f0982be0d4 100644 --- a/components/speedreader/speedreader_throttle.cc +++ b/components/speedreader/speedreader_throttle.cc @@ -6,7 +6,9 @@ #include "brave/components/speedreader/speedreader_throttle.h" #include -#include "brave/components/speedreader/speedreader_loader.h" + +#include "brave/components/speedreader/speedreader_url_loader.h" +#include "brave/components/speedreader/speedreader_whitelist.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "services/network/public/mojom/url_response_head.mojom.h" @@ -14,8 +16,9 @@ namespace speedreader { SpeedReaderThrottle::SpeedReaderThrottle( + SpeedreaderWhitelist* whitelist, scoped_refptr task_runner) - : task_runner_(std::move(task_runner)) {} + : speedreader_whitelist_(whitelist), task_runner_(std::move(task_runner)) {} SpeedReaderThrottle::~SpeedReaderThrottle() = default; @@ -30,13 +33,12 @@ void SpeedReaderThrottle::WillProcessResponse( mojo::PendingRemote new_remote; mojo::PendingReceiver new_receiver; mojo::PendingRemote source_loader; - mojo::PendingReceiver - source_client_receiver; + mojo::PendingReceiver source_client_receiver; SpeedReaderURLLoader* speedreader_loader; std::tie(new_remote, new_receiver, speedreader_loader) = SpeedReaderURLLoader::CreateLoader(weak_factory_.GetWeakPtr(), - response_url, - task_runner_); + response_url, task_runner_, + speedreader_whitelist_); delegate_->InterceptResponse(std::move(new_remote), std::move(new_receiver), &source_loader, &source_client_receiver); speedreader_loader->Start(std::move(source_loader), diff --git a/components/speedreader/speedreader_throttle.h b/components/speedreader/speedreader_throttle.h index 68f8b22ea9a6..863bb24ae99b 100644 --- a/components/speedreader/speedreader_throttle.h +++ b/components/speedreader/speedreader_throttle.h @@ -12,6 +12,8 @@ namespace speedreader { +class SpeedreaderWhitelist; + // Launches the speedreader distillation pass over a reponce body, deferring // the load until distillation is done. // TODO(iefremov): Avoid distilling the same page twice (see comments in @@ -23,8 +25,8 @@ class SpeedReaderThrottle : public blink::URLLoaderThrottle { // |task_runner| is used to bind the right task runner for handling incoming // IPC in SpeedReaderLoader. |task_runner| is supposed to be bound to the // current sequence. - explicit SpeedReaderThrottle( - scoped_refptr task_runner); + SpeedReaderThrottle(SpeedreaderWhitelist* whitelist, + scoped_refptr task_runner); ~SpeedReaderThrottle() override; SpeedReaderThrottle(const SpeedReaderThrottle&) = delete; @@ -39,6 +41,7 @@ class SpeedReaderThrottle : public blink::URLLoaderThrottle { void Resume(); private: + SpeedreaderWhitelist* speedreader_whitelist_; // not owned scoped_refptr task_runner_; base::WeakPtrFactory weak_factory_{this}; }; diff --git a/components/speedreader/speedreader_loader.cc b/components/speedreader/speedreader_url_loader.cc similarity index 90% rename from components/speedreader/speedreader_loader.cc rename to components/speedreader/speedreader_url_loader.cc index e2eed628d876..c7f3bf047b86 100644 --- a/components/speedreader/speedreader_loader.cc +++ b/components/speedreader/speedreader_url_loader.cc @@ -3,14 +3,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "brave/components/speedreader/speedreader_loader.h" +#include "brave/components/speedreader/speedreader_url_loader.h" +#include +#include #include #include "base/bind.h" #include "base/metrics/histogram_macros.h" #include "base/task/post_task.h" +#include "brave/components/speedreader/rust/ffi/speedreader.h" #include "brave/components/speedreader/speedreader_throttle.h" +#include "brave/components/speedreader/speedreader_whitelist.h" #include "components/grit/brave_components_resources.h" #include "mojo/public/cpp/bindings/self_owned_receiver.h" #include "services/network/public/mojom/url_response_head.mojom.h" @@ -39,7 +43,8 @@ std::tuple, SpeedReaderURLLoader::CreateLoader( base::WeakPtr throttle, const GURL& response_url, - scoped_refptr task_runner) { + scoped_refptr task_runner, + SpeedreaderWhitelist* whitelist) { mojo::PendingRemote url_loader; mojo::PendingRemote url_loader_client; mojo::PendingReceiver @@ -48,7 +53,7 @@ SpeedReaderURLLoader::CreateLoader( auto loader = base::WrapUnique(new SpeedReaderURLLoader( std::move(throttle), response_url, std::move(url_loader_client), - std::move(task_runner))); + std::move(task_runner), whitelist)); SpeedReaderURLLoader* loader_rawptr = loader.get(); mojo::MakeSelfOwnedReceiver(std::move(loader), url_loader.InitWithNewPipeAndPassReceiver()); @@ -61,7 +66,8 @@ SpeedReaderURLLoader::SpeedReaderURLLoader( const GURL& response_url, mojo::PendingRemote destination_url_loader_client, - scoped_refptr task_runner) + scoped_refptr task_runner, + SpeedreaderWhitelist* whitelist) : throttle_(throttle), destination_url_loader_client_(std::move(destination_url_loader_client)), response_url_(response_url), @@ -71,7 +77,8 @@ SpeedReaderURLLoader::SpeedReaderURLLoader( task_runner), body_producer_watcher_(FROM_HERE, mojo::SimpleWatcher::ArmingPolicy::MANUAL, - std::move(task_runner)) {} + std::move(task_runner)), + whitelist_(whitelist) {} SpeedReaderURLLoader::~SpeedReaderURLLoader() = default; @@ -234,7 +241,7 @@ void SpeedReaderURLLoader::OnBodyWritable(MojoResult r) { void SpeedReaderURLLoader::MaybeLaunchSpeedreader() { DCHECK_EQ(State::kLoading, state_); - if (!throttle_) { + if (!throttle_ || !whitelist_) { Abort(); return; } @@ -247,30 +254,20 @@ void SpeedReaderURLLoader::MaybeLaunchSpeedreader() { base::PostTaskAndReplyWithResult( FROM_HERE, {base::ThreadPool(), base::TaskPriority::USER_BLOCKING}, base::BindOnce( - [](GURL url, std::string data) -> auto { + [](std::string data, std::unique_ptr rewriter) -> auto { SCOPED_UMA_HISTOGRAM_TIMER("Brave.Speedreader.Distill"); - SpeedReader speedreader; - speedreader.reset(url.spec().c_str()); - // TODO(iefremov): Change speedreader API to accept the data size? - data.push_back('\0'); - speedreader.pumpContent(data.data()); - - std::string transformed; - const bool readable = speedreader.finalize(&transformed); - VLOG(2) << __func__ << " readable = " << readable; - if (!readable) { - // Return the initial data. - DCHECK_EQ('\0', data.back()); - data.pop_back(); + int written = rewriter->Write(data.c_str(), data.length()); + // Error occurred + if (written != 0) { return data; } - const std::string distilled = - GetDistilledPageResources() + transformed; - VLOG(2) << "Distilled size = " << distilled.size(); - return distilled; + rewriter->End(); + const std::string& transformed = rewriter->GetOutput(); + + return GetDistilledPageResources() + transformed; }, - response_url_, std::move(buffered_body_)), + std::move(buffered_body_), whitelist_->MakeRewriter(response_url_)), base::BindOnce(&SpeedReaderURLLoader::CompleteLoading, weak_factory_.GetWeakPtr())); return; diff --git a/components/speedreader/speedreader_loader.h b/components/speedreader/speedreader_url_loader.h similarity index 87% rename from components/speedreader/speedreader_loader.h rename to components/speedreader/speedreader_url_loader.h index 098872570167..5d7ca22d2aac 100644 --- a/components/speedreader/speedreader_loader.h +++ b/components/speedreader/speedreader_url_loader.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_SPEEDREADER_SPEEDREADER_LOADER_H_ -#define BRAVE_COMPONENTS_SPEEDREADER_SPEEDREADER_LOADER_H_ +#ifndef BRAVE_COMPONENTS_SPEEDREADER_SPEEDREADER_URL_LOADER_H_ +#define BRAVE_COMPONENTS_SPEEDREADER_SPEEDREADER_URL_LOADER_H_ #include #include @@ -14,7 +14,6 @@ #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/strings/string_piece.h" -#include "brave/vendor/speedreader_rust_ffi/src/wrapper.hpp" #include "mojo/public/cpp/bindings/binding.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" @@ -29,6 +28,7 @@ namespace speedreader { class SpeedReaderThrottle; +class SpeedreaderWhitelist; // Loads the whole response body and tries to Speedreader-distill it. // Cargoculted from |`SniffingURLLoader|. @@ -51,9 +51,8 @@ class SpeedReaderThrottle; // kAborted: Unexpected behavior happens. Watchers, pipes and the binding from // the source loader to |this| are stopped. All incoming messages from // the destination (through network::mojom::URLLoader) are ignored in -class SpeedReaderURLLoader - : public network::mojom::URLLoaderClient, - public network::mojom::URLLoader { +class SpeedReaderURLLoader : public network::mojom::URLLoaderClient, + public network::mojom::URLLoader { public: ~SpeedReaderURLLoader() override; @@ -73,15 +72,16 @@ class SpeedReaderURLLoader SpeedReaderURLLoader*> CreateLoader(base::WeakPtr throttle, const GURL& response_url, - scoped_refptr task_runner); + scoped_refptr task_runner, + SpeedreaderWhitelist* whitelist); private: - SpeedReaderURLLoader( - base::WeakPtr throttle, - const GURL& response_url, - mojo::PendingRemote - destination_url_loader_client, - scoped_refptr task_runner); + SpeedReaderURLLoader(base::WeakPtr throttle, + const GURL& response_url, + mojo::PendingRemote + destination_url_loader_client, + scoped_refptr task_runner, + SpeedreaderWhitelist* whitelist); // network::mojom::URLLoaderClient implementation (called from the source of // the response): @@ -146,9 +146,12 @@ class SpeedReaderURLLoader mojo::SimpleWatcher body_consumer_watcher_; mojo::SimpleWatcher body_producer_watcher_; + // Not Owned + SpeedreaderWhitelist* whitelist_; + base::WeakPtrFactory weak_factory_{this}; }; } // namespace speedreader -#endif // BRAVE_COMPONENTS_SPEEDREADER_SPEEDREADER_LOADER_H_ +#endif // BRAVE_COMPONENTS_SPEEDREADER_SPEEDREADER_URL_LOADER_H_ diff --git a/components/speedreader/speedreader_whitelist.cc b/components/speedreader/speedreader_whitelist.cc index 0316e8ce91f1..b978c8793fbc 100644 --- a/components/speedreader/speedreader_whitelist.cc +++ b/components/speedreader/speedreader_whitelist.cc @@ -8,29 +8,54 @@ #include #include "base/bind.h" +#include "base/command_line.h" #include "base/files/file_path.h" #include "base/task/post_task.h" -#include "brave/vendor/adblock_rust_ffi/src/wrapper.hpp" +#include "brave/components/speedreader/rust/ffi/speedreader.h" +#include "brave/components/speedreader/speedreader_switches.h" #include "url/gurl.h" namespace speedreader { namespace { +constexpr base::FilePath::CharType kDatFileVersion[] = FILE_PATH_LITERAL("1"); + constexpr base::FilePath::CharType kDatFileName[] = - FILE_PATH_LITERAL("\rs-SpeedreaderWhitelist.dat"); + FILE_PATH_LITERAL("speedreader-updater.dat"); -constexpr char kComponentName[] = "Speedreader"; -// TODO(iefremov): -constexpr char kComponentId[] = ""; -constexpr char kComponentPublicKey[] = ""; +constexpr char kComponentName[] = "Brave SpeedReader Updater"; +constexpr char kComponentId[] = "jicbkmdloagakknpihibphagfckhjdih"; +constexpr char kComponentPublicKey[] = + "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3j/+grwCsrYVA99oDHa+E9z5edPIV" + "3J+lzld3X7K8wfJXbSauGf2DSxW0UEh+MqkkcIK/66Kkd4veuWqnUCAGXUzrHVy/N6kksDkrS" + "cOlpKT9zfyIvLc/4nmiyPCSc5c7UrDVUwZnIUBBpEHiwkpiM4pujeJkZSl5783RWIDRN92GDB" + "dHMdD97JH3bPp3SCTmfAAHzzYUAHUSrOAfodD8qWkfWT19VigseIqwK6dH30uFgaZIOwU9uJV" + "2Ts/TDEddNv8eV7XbwQdL1HUEoFj+RXDq1CuQJjvQdc7YRmy0WGV0GIXu0lAFOQ6D/Z/rjtOe" + "//2uc4zIkviMcUlrvHaJwIDAQAB"; } // namespace SpeedreaderWhitelist::SpeedreaderWhitelist(Delegate* delegate) : brave_component_updater::BraveComponent(delegate), - engine_(new adblock::Engine) { - Register(kComponentName, kComponentId, kComponentPublicKey); + speedreader_(new speedreader::SpeedReader) { + const auto* cmd_line = base::CommandLine::ForCurrentProcess(); + if (!cmd_line->HasSwitch(speedreader::kSpeedreaderWhitelistPath)) { + // Register component + Register(kComponentName, kComponentId, kComponentPublicKey); + } else { + const base::FilePath whitelist_path( + cmd_line->GetSwitchValuePath(speedreader::kSpeedreaderWhitelistPath)); + VLOG(2) << "Speedreader whitelist from " << whitelist_path; + + base::PostTaskAndReplyWithResult( + FROM_HERE, {base::ThreadPool(), base::MayBlock()}, + base::BindOnce( + &brave_component_updater::LoadDATFileData, + whitelist_path), + base::BindOnce(&SpeedreaderWhitelist::OnGetDATFileData, + weak_factory_.GetWeakPtr())); + } } SpeedreaderWhitelist::~SpeedreaderWhitelist() = default; @@ -40,24 +65,23 @@ void SpeedreaderWhitelist::OnComponentReady(const std::string& component_id, const std::string& manifest) { base::PostTaskAndReplyWithResult( FROM_HERE, {base::ThreadPool(), base::MayBlock()}, - base::BindOnce(&brave_component_updater::LoadDATFileData, - install_dir.Append(kDatFileName)), + base::BindOnce( + &brave_component_updater::LoadDATFileData, + install_dir.Append(kDatFileVersion).Append(kDatFileName)), base::BindOnce(&SpeedreaderWhitelist::OnGetDATFileData, weak_factory_.GetWeakPtr())); } bool SpeedreaderWhitelist::IsWhitelisted(const GURL& url) { - bool explicit_cancel; - bool saved_from_exception; - std::string redirect; + return speedreader_->IsReadableURL(url.spec()); +} - return engine_->matches(url.spec(), url.host(), url.host(), - false, "sub_frame", &explicit_cancel, - &saved_from_exception, &redirect); +std::unique_ptr SpeedreaderWhitelist::MakeRewriter(const GURL& url) { + return speedreader_->MakeRewriter(url.spec()); } void SpeedreaderWhitelist::OnGetDATFileData(GetDATFileDataResult result) { - engine_ = std::move(result.first); + speedreader_ = std::move(result.first); } } // namespace speedreader diff --git a/components/speedreader/speedreader_whitelist.h b/components/speedreader/speedreader_whitelist.h index f00e304021d3..4fe935560741 100644 --- a/components/speedreader/speedreader_whitelist.h +++ b/components/speedreader/speedreader_whitelist.h @@ -13,9 +13,10 @@ #include "brave/components/brave_component_updater/browser/brave_component.h" #include "brave/components/brave_component_updater/browser/dat_file_util.h" -namespace adblock { -class Engine; -} +namespace speedreader { +class SpeedReader; +class Rewriter; +} // namespace speedreader class GURL; @@ -30,6 +31,7 @@ class SpeedreaderWhitelist : public brave_component_updater::BraveComponent { SpeedreaderWhitelist& operator=(const SpeedreaderWhitelist&) = delete; bool IsWhitelisted(const GURL& url); + std::unique_ptr MakeRewriter(const GURL& url); private: // brave_component_updater::BraveComponent: @@ -38,11 +40,11 @@ class SpeedreaderWhitelist : public brave_component_updater::BraveComponent { const std::string& manifest) override; using GetDATFileDataResult = - brave_component_updater::LoadDATFileDataResult; + brave_component_updater::LoadDATFileDataResult; void OnGetDATFileData(GetDATFileDataResult result); - std::unique_ptr engine_; + std::unique_ptr speedreader_; base::WeakPtrFactory weak_factory_{this}; }; diff --git a/script/cargo.py b/script/cargo.py index 649b79165d21..b8ff93d5437c 100755 --- a/script/cargo.py +++ b/script/cargo.py @@ -12,15 +12,6 @@ from rust_deps_config import RUST_DEPS_PACKAGE_VERSION -def get_target_arch(target): - return { - 'arm-linux-androideabi': 'arm', - 'aarch64-linux-android': 'arm64', - 'i686-linux-android': 'x86', - 'x86_64-linux-android': 'x86_64', - }[target] - - def build(args): rustup_path = args.rustup_path cargo_path = args.cargo_path @@ -42,15 +33,9 @@ def build(args): rustup_bin_exe = os.path.join(rustup_bin, 'cargo.exe') env['PATH'] = rustup_bin + os.pathsep + env['PATH'] - if (target == 'arm-linux-androideabi' or - target == 'aarch64-linux-android' or - target == 'i686-linux-android' or - target == 'x86_64-linux-android'): - target_arch = get_target_arch(target) - + if args.toolchain: toolchains_path = os.path.abspath( - os.path.join(rustup_path, 'toolchains', target_arch, "bin")) - + os.path.join(rustup_path, 'toolchains', args.toolchain, "bin")) env['PATH'] = toolchains_path + os.pathsep + env['PATH'] if args.mac_deployment_target is not None: @@ -103,6 +88,7 @@ def parse_args(): parser.add_argument('--manifest_path', required=True) parser.add_argument('--build_path', required=True) parser.add_argument('--target', required=True) + parser.add_argument('--toolchain') parser.add_argument('--is_debug', required=True) parser.add_argument('--mac_deployment_target') parser.add_argument('--rust_flags') diff --git a/script/cargo_cbindgen.py b/script/cargo_cbindgen.py new file mode 100755 index 000000000000..366c65db8a7a --- /dev/null +++ b/script/cargo_cbindgen.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this file, +# You can obtain one at http://mozilla.org/MPL/2.0/. + +import argparse +import os +import sys +import subprocess +import shutil + +from rust_deps_config import RUST_DEPS_PACKAGE_VERSION + + +def run(args): + # Set environment variables for rustup + env = os.environ.copy() + + rustup_home = os.path.join(args.rustup_path, RUST_DEPS_PACKAGE_VERSION) + env["RUSTUP_HOME"] = rustup_home + + cargo_home = os.path.join(args.cargo_path, RUST_DEPS_PACKAGE_VERSION) + env["CARGO_HOME"] = cargo_home + + rustup_bin = os.path.abspath(os.path.join(rustup_home, "bin")) + cbindgen_bin = os.path.join( + rustup_bin, "cbindgen" if sys.platform != "win32" else "cbindgen.exe" + ) + env["PATH"] = rustup_bin + os.pathsep + env["PATH"] + + # Install the tool + cargo_args = [] + cargo_args.append(cbindgen_bin) + cargo_args.append("--config") + cargo_args.append(args.config) + cargo_args.append("--output") + cargo_args.append(args.output) + cargo_args.append(args.path) + + try: + subprocess.check_call(cargo_args, env=env) + except subprocess.CalledProcessError as e: + raise e + + +def parse_args(): + parser = argparse.ArgumentParser(description="Cargo cbindgen") + + parser.add_argument("--rustup_path", required=True) + parser.add_argument("--cargo_path", required=True) + parser.add_argument("--path", required=True) + parser.add_argument("--config", required=True) + parser.add_argument("--output", required=True) + + args = parser.parse_args() + + return args + + +def main(): + run(parse_args()) + + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/script/download_rust_deps.py b/script/download_rust_deps.py index 734bc519b900..b12a5ecc345e 100755 --- a/script/download_rust_deps.py +++ b/script/download_rust_deps.py @@ -131,6 +131,29 @@ def parse_args(): return args +def cargo_install(tool): + # Set environment variables for rustup + env = os.environ.copy() + env['RUSTUP_HOME'] = RUSTUP_HOME + env['CARGO_HOME'] = RUSTUP_HOME + + rustup_bin = os.path.abspath(os.path.join(RUSTUP_HOME, 'bin')) + cargo_bin = os.path.join(rustup_bin, "cargo" if sys.platform != "win32" else "cargo.exe") + + # Install the tool + cargo_args = [] + cargo_args.append(cargo_bin) + cargo_args.append("install") + cargo_args.append("--force") + cargo_args.append(tool) + + try: + subprocess.check_call(cargo_args, env=env) + except subprocess.CalledProcessError as e: + print(e.output) + raise e + + def main(): download_and_unpack_rust_deps(sys.platform) @@ -138,6 +161,10 @@ def main(): if args.platform == 'android': make_standalone_toolchain_for_android() + tools = ["cbindgen"] + for tool in tools: + cargo_install(tool) + return 0 diff --git a/test/BUILD.gn b/test/BUILD.gn index d33506bfbeca..e2fe2274707b 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -39,7 +39,7 @@ group("fix_brave_test_install_name_speedreader") { testonly = true if (enable_speedreader) { deps = [ - "//brave/vendor/speedreader_rust_ffi:test_speedreader_install_name", + "//brave/components/speedreader/rust/ffi:test_install_name_speedreader", ] } } @@ -490,6 +490,16 @@ test("brave_unit_tests") { "//brave/components/brave_perf_predictor/browser", ] } + + if (enable_speedreader) { + sources += [ + "//brave/components/speedreader/rust/ffi/speedreader_unittest.cc", + ] + + deps += [ + "//brave/components/speedreader/rust/ffi:speedreader_ffi" + ] + } } } diff --git a/test/data/speedreader_whitelist.json b/test/data/speedreader_whitelist.json new file mode 100644 index 000000000000..43ac8f88a5e0 --- /dev/null +++ b/test/data/speedreader_whitelist.json @@ -0,0 +1,38 @@ +[ + { + "domain": "theguardian.com", + "url_rules": [ + "||theguardian.com" + ], + "declarative_rewrite": { + "main_content": [ + "article header", + ".content__article-body" + ], + "main_content_cleanup": [ + ".hide-on-mobile", + ".inline-icon", + ".atom__button", + "input", + ".meta__extras", + ".content__headline-showcase-wrapper", + ".fc-container__header", + "figure.element-embed", + ".vjs-control-text" + ], + "delazify": true, + "fix_embeds": true, + "content_script": "", + "preprocess": [ + { + "selector": ".vjs-big-play-button[style]", + "attribute": [ + "style", + "data-src-background" + ], + "element_name": "img" + } + ] + } + } +]