diff --git a/main.cpp b/main.cpp index 4389224..72770f0 100644 --- a/main.cpp +++ b/main.cpp @@ -21,7 +21,12 @@ # include #endif +#include + int main(int argc, char *argv[]) { + // cv::dnn::readNetFromTensorflow("/home/leca/model.keras"); + + // return 0; curl_global_init(CURL_GLOBAL_ALL); qRegisterMetaType("Check"); diff --git a/translations/en_US.ts b/translations/en_US.ts index ea8af57..39acac3 100644 --- a/translations/en_US.ts +++ b/translations/en_US.ts @@ -669,7 +669,7 @@ QObject - + Using locale: Using locale: diff --git a/translations/ru_RU.ts b/translations/ru_RU.ts index cdb6b82..b8d0406 100644 --- a/translations/ru_RU.ts +++ b/translations/ru_RU.ts @@ -645,7 +645,7 @@ QObject - + Using locale: Использую локаль: diff --git a/utils/utils.cpp b/utils/utils.cpp index 42fbe42..83b4078 100644 --- a/utils/utils.cpp +++ b/utils/utils.cpp @@ -229,8 +229,7 @@ std::vector find_products_in_html(std::string html) { } std::vector find_amounts_in_html(std::string html) { - return find_in_html(html, "(?<=X <\\/span>)\\d+(\\.|,)\\d{2}(?=<\\/span>)"); - + return find_in_html(html, "(?<=
)\\d+(\\.|\\,)?\\d{0,3}(?=<\\/span>)"); } std::vector find_net_weights_in_names(std::vector &names) { @@ -257,7 +256,7 @@ std::vector find_net_weights_in_names(std::vector &n } std::vector find_prices_in_html(std::string html) { - return find_in_html(html, "(?<=
)\\d+(\\.|\\,)?\\d{0,3}(?=<\\/span>)"); + return find_in_html(html, "(?<=X <\\/span>)\\d+(\\.|,)\\d{2}(?=<\\/span>)"); } void dumpVectorsToStderr(std::vector &products, std::vector &amounts, std::vector &net_weights, std::vector &prices) { @@ -321,6 +320,7 @@ Check parseOfdRuAnswer(std::string html) { for (int i = 0; i < products.size(); i ++) { // std::cout << "Adding to check: "; // std::cout << to_utf8(products[i]) << " " << to_utf8(prices[i]) << " " << to_utf8(net_weights[i]) << " " << to_utf8(amounts[i]) << std::endl; + std::replace(amounts[i].begin(), amounts[i].end(), from_utf8(",")[0], from_utf8(".")[0]); Goods goods(to_utf8(products[i]), std::stod(prices[i]), to_utf8(net_weights[i]), std::stod(amounts[i])); c.add_goods(goods); }