• Home
  • Raw
  • Download

Lines Matching refs:classifier

80   std::unique_ptr<Annotator> classifier =  in TEST_F()  local
83 EXPECT_FALSE(classifier); in TEST_F()
86 void VerifyClassifyText(const Annotator* classifier) { in VerifyClassifyText() argument
87 ASSERT_TRUE(classifier); in VerifyClassifyText()
90 FirstResult(classifier->ClassifyText( in VerifyClassifyText()
92 EXPECT_EQ("phone", FirstResult(classifier->ClassifyText( in VerifyClassifyText()
97 FirstResult(classifier->ClassifyText( in VerifyClassifyText()
102 FirstResult(classifier->ClassifyText( in VerifyClassifyText()
108 EXPECT_EQ("other", FirstResult(classifier->ClassifyText("obama", {0, 5}))); in VerifyClassifyText()
109 EXPECT_EQ("other", FirstResult(classifier->ClassifyText("asdf", {0, 4}))); in VerifyClassifyText()
112 classifier->ClassifyText("", {0, 0}); in VerifyClassifyText()
113 classifier->ClassifyText("asdf", {0, 0}); in VerifyClassifyText()
114 classifier->ClassifyText("asdf", {0, 27}); in VerifyClassifyText()
115 classifier->ClassifyText("asdf", {-30, 300}); in VerifyClassifyText()
116 classifier->ClassifyText("asdf", {-10, -1}); in VerifyClassifyText()
117 classifier->ClassifyText("asdf", {100, 17}); in VerifyClassifyText()
118 classifier->ClassifyText("a\n\n\n\nx x x\n\n\n\n\n\n", {1, 5}); in VerifyClassifyText()
121 EXPECT_EQ("<INVALID RESULTS>", FirstResult(classifier->ClassifyText( in VerifyClassifyText()
126 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
128 VerifyClassifyText(classifier.get()); in TEST_F()
132 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
134 ASSERT_TRUE(classifier); in TEST_F()
136 EXPECT_EQ("other", FirstResult(classifier->ClassifyText("isotope", {0, 7}))); in TEST_F()
140 EXPECT_EQ("dictionary", FirstResult(classifier->ClassifyText( in TEST_F()
144 EXPECT_EQ("other", FirstResult(classifier->ClassifyText( in TEST_F()
149 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
151 ASSERT_TRUE(classifier); in TEST_F()
157 EXPECT_EQ("dictionary", FirstResult(classifier->ClassifyText( in TEST_F()
163 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
165 ASSERT_TRUE(classifier); in TEST_F()
174 EXPECT_EQ("dictionary", FirstResult(classifier->ClassifyText( in TEST_F()
177 EXPECT_EQ("other", FirstResult(classifier->ClassifyText( in TEST_F()
194 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
199 ASSERT_FALSE(classifier); in TEST_F()
211 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
214 ASSERT_TRUE(classifier); in TEST_F()
217 classifier->ClassifyText("Call me at (800) 123-456 today", {11, 24}), in TEST_F()
224 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
226 ASSERT_TRUE(classifier); in TEST_F()
228 EXPECT_EQ("phone", FirstResult(classifier->ClassifyText( in TEST_F()
241 classifier = Annotator::FromUnownedBuffer( in TEST_F()
244 ASSERT_TRUE(classifier); in TEST_F()
246 EXPECT_EQ("other", FirstResult(classifier->ClassifyText( in TEST_F()
250 EXPECT_EQ("address", FirstResult(classifier->ClassifyText( in TEST_F()
277 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
280 ASSERT_TRUE(classifier); in TEST_F()
283 FirstResult(classifier->ClassifyText( in TEST_F()
286 FirstResult(classifier->ClassifyText( in TEST_F()
289 FirstResult(classifier->ClassifyText("you@android.com", {0, 15}))); in TEST_F()
290 EXPECT_EQ("email", FirstResult(classifier->ClassifyText( in TEST_F()
293 EXPECT_EQ("url", FirstResult(classifier->ClassifyText( in TEST_F()
296 EXPECT_EQ("flight", FirstResult(classifier->ClassifyText("LX 37", {0, 5}))); in TEST_F()
297 EXPECT_EQ("flight", FirstResult(classifier->ClassifyText("flight LX 37 abcd", in TEST_F()
299 EXPECT_EQ("payment_card", FirstResult(classifier->ClassifyText( in TEST_F()
301 EXPECT_EQ("payment_card", FirstResult(classifier->ClassifyText( in TEST_F()
304 EXPECT_EQ("other", FirstResult(classifier->ClassifyText("2221 0067 4735 6282", in TEST_F()
309 FirstResult(classifier->ClassifyText( in TEST_F()
335 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
338 ASSERT_TRUE(classifier); in TEST_F()
341 EXPECT_EQ("parcel_tracking", FirstResult(classifier->ClassifyText( in TEST_F()
345 EXPECT_EQ("other", FirstResult(classifier->ClassifyText( in TEST_F()
362 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
365 ASSERT_TRUE(classifier); in TEST_F()
370 classifier->ClassifyText("Barack Obama is 57 years old", {0, 28}); in TEST_F()
397 classifier->ClassifyText("Barack is 57 years old", {0, 22}); in TEST_F()
441 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
444 ASSERT_TRUE(classifier); in TEST_F()
447 classifier->ClassifyText("Barack Obama is 57 years old", {0, 28}); in TEST_F()
477 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
480 ASSERT_TRUE(classifier); in TEST_F()
483 FirstResult(classifier->ClassifyText( in TEST_F()
491 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
494 ASSERT_TRUE(classifier); in TEST_F()
497 FirstResult(classifier->ClassifyText( in TEST_F()
524 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
527 ASSERT_TRUE(classifier); in TEST_F()
530 classifier->Annotate("Your flight LX373 is delayed by 3 hours."); in TEST_F()
542 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
545 ASSERT_TRUE(classifier); in TEST_F()
548 classifier->Annotate("Your flight LX373 is delayed by 3 hours."); in TEST_F()
579 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
582 ASSERT_TRUE(classifier); in TEST_F()
585 EXPECT_EQ(classifier->SuggestSelection( in TEST_F()
588 EXPECT_EQ(classifier->SuggestSelection( in TEST_F()
591 EXPECT_EQ(classifier->SuggestSelection("cc: 4012 8888 8888 1881", {9, 14}), in TEST_F()
625 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
628 ASSERT_TRUE(classifier); in TEST_F()
631 EXPECT_EQ(classifier->SuggestSelection("it's from 04/30/1789 to 03/04/1797", in TEST_F()
634 EXPECT_EQ(classifier->SuggestSelection("it takes for ever", {9, 12}), in TEST_F()
654 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
657 ASSERT_TRUE(classifier); in TEST_F()
661 classifier->SuggestSelection( in TEST_F()
683 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
686 ASSERT_TRUE(classifier); in TEST_F()
690 classifier->SuggestSelection( in TEST_F()
718 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
721 ASSERT_TRUE(classifier); in TEST_F()
726 EXPECT_THAT(classifier->Annotate(test_string), in TEST_F()
734 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
736 ASSERT_TRUE(classifier); in TEST_F()
741 EXPECT_THAT(classifier->Annotate(test_string), in TEST_F()
767 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
770 ASSERT_TRUE(classifier); in TEST_F()
774 EXPECT_THAT(classifier->Annotate(test_string), in TEST_F()
791 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
794 ASSERT_TRUE(classifier); in TEST_F()
799 classifier->Annotate("Barack Obama is 57 years old", options); in TEST_F()
843 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
846 ASSERT_TRUE(classifier); in TEST_F()
851 classifier->Annotate("Barack Obama is 57 years old", options); in TEST_F()
876 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
879 ASSERT_TRUE(classifier); in TEST_F()
884 classifier->Annotate("Barack Obama is 57 years old", options); in TEST_F()
894 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
896 ASSERT_TRUE(classifier); in TEST_F()
898 EXPECT_EQ("phone", FirstResult(classifier->ClassifyText( in TEST_F()
900 EXPECT_EQ("phone", FirstResult(classifier->ClassifyText( in TEST_F()
902 EXPECT_EQ("other", FirstResult(classifier->ClassifyText( in TEST_F()
907 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
909 ASSERT_TRUE(classifier); in TEST_F()
911 EXPECT_EQ(classifier->SuggestSelection( in TEST_F()
918 classifier->SuggestSelection("350 Third Street, Cambridge", {0, 27}), in TEST_F()
922 EXPECT_EQ(classifier->SuggestSelection("a", {0, 1}), CodepointSpan(0, 1)); in TEST_F()
925 EXPECT_EQ(classifier->SuggestSelection("asdf", {0, 4}), CodepointSpan(0, 4)); in TEST_F()
928 classifier->SuggestSelection("call me at 857 225 3556 today", {11, 14}), in TEST_F()
933 classifier->SuggestSelection("call me at (857) 225 3556 today", {12, 14}), in TEST_F()
935 EXPECT_EQ(classifier->SuggestSelection("call me at (857 today", {12, 14}), in TEST_F()
937 EXPECT_EQ(classifier->SuggestSelection("call me at 3556) today", {12, 14}), in TEST_F()
939 EXPECT_EQ(classifier->SuggestSelection("call me at )857( today", {12, 14}), in TEST_F()
943 EXPECT_EQ(classifier->SuggestSelection("call me at )( today", {11, 13}), in TEST_F()
945 EXPECT_EQ(classifier->SuggestSelection("call me at ( today", {11, 12}), in TEST_F()
947 EXPECT_EQ(classifier->SuggestSelection("call me at ) today", {11, 12}), in TEST_F()
953 classifier->SuggestSelection("call me at 857 225 3556 today", {5, 24}), in TEST_F()
969 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
973 ASSERT_FALSE(classifier); in TEST_F()
993 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
996 ASSERT_TRUE(classifier); in TEST_F()
999 classifier->SuggestSelection("call me at 857 225 3556 today", {11, 14}), in TEST_F()
1002 EXPECT_EQ("phone", FirstResult(classifier->ClassifyText( in TEST_F()
1005 EXPECT_THAT(classifier->Annotate("call me at (800) 123-456 today"), in TEST_F()
1012 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
1014 ASSERT_TRUE(classifier); in TEST_F()
1017 classifier->SuggestSelection("call me at 857 225 3556 today", {11, 14}), in TEST_F()
1032 classifier = Annotator::FromUnownedBuffer( in TEST_F()
1035 ASSERT_TRUE(classifier); in TEST_F()
1038 classifier->SuggestSelection("call me at 857 225 3556 today", {11, 14}), in TEST_F()
1042 EXPECT_EQ(classifier->SuggestSelection("350 Third Street, Cambridge", {4, 9}), in TEST_F()
1047 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
1049 ASSERT_TRUE(classifier); in TEST_F()
1051 EXPECT_EQ(classifier->SuggestSelection("350 Third Street, Cambridge", {0, 3}), in TEST_F()
1053 EXPECT_EQ(classifier->SuggestSelection("350 Third Street, Cambridge", {4, 9}), in TEST_F()
1056 classifier->SuggestSelection("350 Third Street, Cambridge", {10, 16}), in TEST_F()
1058 EXPECT_EQ(classifier->SuggestSelection("a\nb\nc\n350 Third Street, Cambridge", in TEST_F()
1064 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
1066 ASSERT_TRUE(classifier); in TEST_F()
1068 EXPECT_EQ(classifier->SuggestSelection("abc\n857 225 3556", {4, 7}), in TEST_F()
1070 EXPECT_EQ(classifier->SuggestSelection("857 225 3556\nabc", {0, 3}), in TEST_F()
1074 EXPECT_EQ(classifier->SuggestSelection("857 225\n3556\nabc", {0, 3}, options), in TEST_F()
1079 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
1081 ASSERT_TRUE(classifier); in TEST_F()
1084 EXPECT_EQ(classifier->SuggestSelection( in TEST_F()
1089 EXPECT_EQ(classifier->SuggestSelection( in TEST_F()
1094 EXPECT_EQ(classifier->SuggestSelection( in TEST_F()
1099 EXPECT_EQ(classifier->SuggestSelection( in TEST_F()
1105 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
1107 ASSERT_TRUE(classifier); in TEST_F()
1110 EXPECT_EQ(classifier->SuggestSelection("", {0, 27}), CodepointSpan(0, 27)); in TEST_F()
1111 EXPECT_EQ(classifier->SuggestSelection("", {-10, 27}), in TEST_F()
1113 EXPECT_EQ(classifier->SuggestSelection("Word 1 2 3 hello!", {0, 27}), in TEST_F()
1115 EXPECT_EQ(classifier->SuggestSelection("Word 1 2 3 hello!", {-30, 300}), in TEST_F()
1117 EXPECT_EQ(classifier->SuggestSelection("Word 1 2 3 hello!", {-10, -1}), in TEST_F()
1119 EXPECT_EQ(classifier->SuggestSelection("Word 1 2 3 hello!", {100, 17}), in TEST_F()
1123 EXPECT_EQ(classifier->SuggestSelection("\xf0\x9f\x98\x8b\x8b", {-1, -1}), in TEST_F()
1128 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
1130 ASSERT_TRUE(classifier); in TEST_F()
1133 classifier->SuggestSelection("call me at 857 225 3556 today", {14, 15}), in TEST_F()
1136 classifier->SuggestSelection("call me at 857 225 3556 today", {10, 11}), in TEST_F()
1139 classifier->SuggestSelection("call me at 857 225 3556 today", {23, 24}), in TEST_F()
1142 classifier->SuggestSelection("call me at 857 225 3556, today", {23, 24}), in TEST_F()
1144 EXPECT_EQ(classifier->SuggestSelection("call me at 857 225 3556, today", in TEST_F()
1148 classifier->SuggestSelection("call me at 857-225 3556, today", {14, 17}), in TEST_F()
1151 classifier->SuggestSelection( in TEST_F()
1154 EXPECT_EQ(classifier->SuggestSelection("call me today", {4, 5}), in TEST_F()
1156 EXPECT_EQ(classifier->SuggestSelection("call me today", {7, 8}), in TEST_F()
1161 classifier->SuggestSelection( in TEST_F()
1166 EXPECT_EQ(classifier->SuggestSelection(" ", {0, 1}), in TEST_F()
1168 EXPECT_EQ(classifier->SuggestSelection(" ", {0, 3}), in TEST_F()
1170 EXPECT_EQ(classifier->SuggestSelection(" ", {2, 3}), in TEST_F()
1172 EXPECT_EQ(classifier->SuggestSelection(" ", {5, 6}), in TEST_F()
1207 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
1209 ASSERT_TRUE(classifier); in TEST_F()
1214 EXPECT_THAT(classifier->Annotate(test_string), in TEST_F()
1221 EXPECT_THAT(classifier->Annotate("853 225 3556", options), in TEST_F()
1223 EXPECT_THAT(classifier->Annotate("853 225\n3556", options), in TEST_F()
1227 classifier->Annotate("853 225 3556\n\xf0\x9f\x98\x8b\x8b", options) in TEST_F()
1232 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
1234 ASSERT_TRUE(classifier); in TEST_F()
1236 EXPECT_THAT(classifier->Annotate("call me at (0845) 100 1000 today"), in TEST_F()
1242 EXPECT_THAT(classifier->Annotate("call me at (07038201818 today"), in TEST_F()
1246 EXPECT_THAT(classifier->Annotate("call me at 07038201818) today"), in TEST_F()
1250 EXPECT_THAT(classifier->Annotate("call me at )07038201818( today"), in TEST_F()
1257 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
1259 ASSERT_TRUE(classifier); in TEST_F()
1264 EXPECT_THAT(classifier->Annotate("call me at (0845) 100 1000 today", options), in TEST_F()
1270 EXPECT_THAT(classifier->Annotate("call me at (07038201818 today", options), in TEST_F()
1274 EXPECT_THAT(classifier->Annotate("call me at 07038201818) today", options), in TEST_F()
1278 EXPECT_THAT(classifier->Annotate("call me at )07038201818( today", options), in TEST_F()
1285 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
1287 ASSERT_TRUE(classifier); in TEST_F()
1293 classifier->Annotate("853 225 3556 and then turn it up 99%, 99 " in TEST_F()
1306 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
1308 ASSERT_TRUE(classifier); in TEST_F()
1312 EXPECT_THAT(classifier->Annotate( in TEST_F()
1318 void VerifyAnnotatesDurationsInRawMode(const Annotator* classifier) { in VerifyAnnotatesDurationsInRawMode() argument
1319 ASSERT_TRUE(classifier); in VerifyAnnotatesDurationsInRawMode()
1324 EXPECT_THAT(classifier->Annotate( in VerifyAnnotatesDurationsInRawMode()
1332 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
1334 VerifyAnnotatesDurationsInRawMode(classifier.get()); in TEST_F()
1338 const Annotator* classifier) { in VerifyDurationAndRelativeTimeCanOverlapInRawMode() argument
1339 ASSERT_TRUE(classifier); in VerifyDurationAndRelativeTimeCanOverlapInRawMode()
1345 classifier->Annotate("let's meet in 3 hours", options); in VerifyDurationAndRelativeTimeCanOverlapInRawMode()
1357 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
1359 VerifyDurationAndRelativeTimeCanOverlapInRawMode(classifier.get()); in TEST_F()
1365 std::unique_ptr<Annotator> classifier = in TEST_F() local
1368 VerifyDurationAndRelativeTimeCanOverlapInRawMode(classifier.get()); in TEST_F()
1376 std::unique_ptr<Annotator> classifier = in TEST_F() local
1380 ASSERT_TRUE(classifier); in TEST_F()
1387 EXPECT_THAT(classifier->Annotate(str1), IsEmpty()); in TEST_F()
1389 classifier->Annotate(str2), in TEST_F()
1394 classifier->Annotate(str3), in TEST_F()
1405 std::unique_ptr<Annotator> classifier = in TEST_F() local
1409 ASSERT_TRUE(classifier); in TEST_F()
1420 classifier->Annotate(str3); in TEST_F()
1437 std::unique_ptr<Annotator> classifier = in TEST_F() local
1441 ASSERT_TRUE(classifier); in TEST_F()
1447 classifier->Annotate(str3); in TEST_F()
1464 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
1467 ASSERT_TRUE(classifier); in TEST_F()
1472 EXPECT_THAT(classifier->Annotate(test_string), in TEST_F()
1479 EXPECT_THAT(classifier->Annotate("853 225 3556", options), in TEST_F()
1481 EXPECT_THAT(classifier->Annotate("853 225\n3556", options), in TEST_F()
1496 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
1499 ASSERT_TRUE(classifier); in TEST_F()
1505 EXPECT_EQ(classifier->Annotate(test_string).size(), 0); in TEST_F()
1520 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
1523 ASSERT_TRUE(classifier); in TEST_F()
1528 EXPECT_EQ(classifier->Annotate(test_string).size(), 2); in TEST_F()
1540 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
1543 ASSERT_TRUE(classifier); in TEST_F()
1547 EXPECT_THAT(classifier->Annotate(test_string), IsEmpty()); in TEST_F()
1553 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
1555 ASSERT_TRUE(classifier); in TEST_F()
1561 EXPECT_THAT(classifier->Annotate(test_string), in TEST_F()
1577 classifier = Annotator::FromUnownedBuffer( in TEST_F()
1580 ASSERT_TRUE(classifier); in TEST_F()
1582 EXPECT_THAT(classifier->Annotate(test_string), in TEST_F()
1591 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
1593 ASSERT_TRUE(classifier); in TEST_F()
1599 EXPECT_THAT(classifier->Annotate(test_string), in TEST_F()
1621 classifier = Annotator::FromUnownedBuffer( in TEST_F()
1624 ASSERT_TRUE(classifier); in TEST_F()
1626 EXPECT_THAT(classifier->Annotate(test_string), in TEST_F()
1632 void VerifyClassifyTextDateInZurichTimezone(const Annotator* classifier) { in VerifyClassifyTextDateInZurichTimezone() argument
1633 EXPECT_TRUE(classifier); in VerifyClassifyTextDateInZurichTimezone()
1639 classifier->ClassifyText("january 1, 2017", {0, 15}, options); in VerifyClassifyTextDateInZurichTimezone()
1647 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
1649 VerifyClassifyTextDateInZurichTimezone(classifier.get()); in TEST_F()
1654 std::unique_ptr<Annotator> classifier = in TEST_F() local
1657 VerifyClassifyTextDateInZurichTimezone(classifier.get()); in TEST_F()
1660 void VerifyClassifyTextDateInLATimezone(const Annotator* classifier) { in VerifyClassifyTextDateInLATimezone() argument
1661 EXPECT_TRUE(classifier); in VerifyClassifyTextDateInLATimezone()
1667 classifier->ClassifyText("march 1, 2017", {0, 13}, options); in VerifyClassifyTextDateInLATimezone()
1676 std::unique_ptr<Annotator> classifier = in TEST_F() local
1679 VerifyClassifyTextDateInLATimezone(classifier.get()); in TEST_F()
1683 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
1685 VerifyClassifyTextDateInLATimezone(classifier.get()); in TEST_F()
1688 void VerifyClassifyTextDateOnAotherLine(const Annotator* classifier) { in VerifyClassifyTextDateOnAotherLine() argument
1689 EXPECT_TRUE(classifier); in VerifyClassifyTextDateOnAotherLine()
1694 std::vector<ClassificationResult> result = classifier->ClassifyText( in VerifyClassifyTextDateOnAotherLine()
1706 std::unique_ptr<Annotator> classifier = in TEST_F() local
1709 VerifyClassifyTextDateOnAotherLine(classifier.get()); in TEST_F()
1713 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
1715 VerifyClassifyTextDateOnAotherLine(classifier.get()); in TEST_F()
1719 const Annotator* classifier) { in VerifyClassifyTextWhenLocaleUSParsesDateAsMonthDay() argument
1720 EXPECT_TRUE(classifier); in VerifyClassifyTextWhenLocaleUSParsesDateAsMonthDay()
1726 result = classifier->ClassifyText("03.05.1970 00:00am", {0, 18}, options); in VerifyClassifyTextWhenLocaleUSParsesDateAsMonthDay()
1735 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
1737 VerifyClassifyTextWhenLocaleUSParsesDateAsMonthDay(classifier.get()); in TEST_F()
1743 std::unique_ptr<Annotator> classifier = in TEST_F() local
1746 VerifyClassifyTextWhenLocaleUSParsesDateAsMonthDay(classifier.get()); in TEST_F()
1751 std::unique_ptr<Annotator> classifier = in TEST_F() local
1754 EXPECT_TRUE(classifier); in TEST_F()
1760 result = classifier->ClassifyText("03.05.1970 00:00vorm", {0, 20}, options); in TEST_F()
1769 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
1771 EXPECT_TRUE(classifier); in TEST_F()
1776 classifier->ClassifyText("set an alarm for 10:30", {17, 22}, options); in TEST_F()
1786 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
1788 EXPECT_TRUE(classifier); in TEST_F()
1793 classifier->Annotate("set an alarm for 10:30", options); in TEST_F()
1816 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
1819 ASSERT_TRUE(classifier); in TEST_F()
1821 FirstResult(classifier->ClassifyText("january 1, 2017", {0, 15}))); in TEST_F()
1822 EXPECT_EQ(classifier->SuggestSelection("january 1, 2017", {0, 7}), in TEST_F()
1824 EXPECT_THAT(classifier->Annotate("january 1, 2017"), in TEST_F()
1866 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
1869 ASSERT_TRUE(classifier); in TEST_F()
1875 EXPECT_THAT(classifier->Annotate(test_string), in TEST_F()
1879 EXPECT_THAT(FirstResult(classifier->ClassifyText("Jessica Fletcher", in TEST_F()
1882 EXPECT_THAT(classifier->SuggestSelection("Jessica Fletcher", {0, 7}), in TEST_F()
1887 TestingAnnotator classifier(unilib_.get(), calendarlib_.get()); in TEST_F() local
1896 classifier.ResolveConflicts(candidates, /*context=*/"", /*cached_tokens=*/{}, in TEST_F()
1903 TestingAnnotator classifier(unilib_.get(), calendarlib_.get()); in TEST_F() local
1917 classifier.ResolveConflicts(candidates, /*context=*/"", /*cached_tokens=*/{}, in TEST_F()
1924 TestingAnnotator classifier(unilib_.get(), calendarlib_.get()); in TEST_F() local
1936 classifier.ResolveConflicts(candidates, /*context=*/"", /*cached_tokens=*/{}, in TEST_F()
1943 TestingAnnotator classifier(unilib_.get(), calendarlib_.get()); in TEST_F() local
1955 classifier.ResolveConflicts(candidates, /*context=*/"", /*cached_tokens=*/{}, in TEST_F()
1962 TestingAnnotator classifier(unilib_.get(), calendarlib_.get()); in TEST_F() local
1975 classifier.ResolveConflicts(candidates, /*context=*/"", /*cached_tokens=*/{}, in TEST_F()
1994 std::unique_ptr<TestingAnnotator> classifier = in TEST_F() local
1998 TC3_CHECK(classifier != nullptr); in TEST_F()
2011 classifier->ResolveConflicts(candidates, /*context=*/"", /*cached_tokens=*/{}, in TEST_F()
2018 TestingAnnotator classifier(unilib_.get(), calendarlib_.get()); in TEST_F() local
2032 classifier.ResolveConflicts(candidates, /*context=*/"", /*cached_tokens=*/{}, in TEST_F()
2039 TestingAnnotator classifier(unilib_.get(), calendarlib_.get()); in TEST_F() local
2051 classifier.ResolveConflicts(candidates, /*context=*/"", /*cached_tokens=*/{}, in TEST_F()
2058 TestingAnnotator classifier(unilib_.get(), calendarlib_.get()); in TEST_F() local
2070 classifier.ResolveConflicts(candidates, /*context=*/"", /*cached_tokens=*/{}, in TEST_F()
2077 TestingAnnotator classifier(unilib_.get(), calendarlib_.get()); in TEST_F() local
2090 classifier.ResolveConflicts(candidates, /*context=*/"", /*cached_tokens=*/{}, in TEST_F()
2097 TestingAnnotator classifier(unilib_.get(), calendarlib_.get()); in TEST_F() local
2108 classifier.ResolveConflicts(candidates, /*context=*/"", /*cached_tokens=*/{}, in TEST_F()
2115 TestingAnnotator classifier( in TEST_F() local
2132 classifier.ResolveConflicts(candidates, /*context=*/"", /*cached_tokens=*/{}, in TEST_F()
2138 void VerifyLongInput(const Annotator* classifier) { in VerifyLongInput() argument
2139 ASSERT_TRUE(classifier); in VerifyLongInput()
2156 EXPECT_THAT(classifier->Annotate(input_100k, annotation_options), in VerifyLongInput()
2161 EXPECT_EQ(classifier->SuggestSelection(input_100k, {50000, 50001}, in VerifyLongInput()
2168 FirstResult(classifier->ClassifyText( in VerifyLongInput()
2175 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
2177 VerifyLongInput(classifier.get()); in TEST_F()
2182 std::unique_ptr<Annotator> classifier = in TEST_F() local
2185 VerifyLongInput(classifier.get()); in TEST_F()
2191 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
2193 ASSERT_TRUE(classifier); in TEST_F()
2201 classifier->Annotate(input_100k); in TEST_F()
2202 classifier->SuggestSelection(input_100k, {50000, 50001}); in TEST_F()
2203 classifier->ClassifyText(input_100k, {50000, 50000 + value_length}); in TEST_F()
2211 std::unique_ptr<Annotator> classifier; in TEST_F() local
2218 classifier = Annotator::FromUnownedBuffer( in TEST_F()
2221 ASSERT_TRUE(classifier); in TEST_F()
2223 EXPECT_EQ(FirstResult(classifier->ClassifyText( in TEST_F()
2232 classifier = Annotator::FromUnownedBuffer( in TEST_F()
2235 ASSERT_TRUE(classifier); in TEST_F()
2237 EXPECT_EQ(FirstResult(classifier->ClassifyText( in TEST_F()
2246 std::unique_ptr<Annotator> classifier; in TEST_F() local
2253 classifier = Annotator::FromUnownedBuffer( in TEST_F()
2256 ASSERT_TRUE(classifier); in TEST_F()
2258 EXPECT_EQ(FirstResult(classifier->ClassifyText( in TEST_F()
2267 classifier = Annotator::FromUnownedBuffer( in TEST_F()
2270 ASSERT_TRUE(classifier); in TEST_F()
2272 EXPECT_EQ(FirstResult(classifier->ClassifyText( in TEST_F()
2284 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
2287 ASSERT_TRUE(classifier); in TEST_F()
2289 EXPECT_EQ(FirstResult(classifier->ClassifyText("LX37", {0, 4})), "other"); in TEST_F()
2299 std::unique_ptr<Annotator> classifier = Annotator::FromUnownedBuffer( in TEST_F() local
2302 ASSERT_TRUE(classifier); in TEST_F()
2304 EXPECT_EQ(FirstResult(classifier->ClassifyText("LX37", {0, 4})), "flight"); in TEST_F()
2328 std::unique_ptr<Annotator> classifier = in TEST_F() local
2331 ASSERT_TRUE(classifier); in TEST_F()
2333 EXPECT_THAT(classifier->Annotate("(555) 225-3556"), in TEST_F()
2336 FirstResult(classifier->ClassifyText("(555) 225-3556", {0, 14}))); in TEST_F()
2337 EXPECT_EQ(classifier->SuggestSelection("(555) 225-3556", {6, 9}), in TEST_F()
2345 std::unique_ptr<Annotator> classifier = in TEST_F() local
2348 ASSERT_TRUE(classifier); in TEST_F()
2352 EXPECT_THAT(classifier->Annotate("(555) 225-3556", options), in TEST_F()
2360 std::unique_ptr<Annotator> classifier = in TEST_F() local
2363 ASSERT_TRUE(classifier); in TEST_F()
2367 EXPECT_THAT(classifier->Annotate("(555) 225-3556", options), IsEmpty()); in TEST_F()
2374 std::unique_ptr<Annotator> classifier = in TEST_F() local
2377 ASSERT_TRUE(classifier); in TEST_F()
2381 EXPECT_EQ("phone", FirstResult(classifier->ClassifyText("(555) 225-3556", in TEST_F()
2390 std::unique_ptr<Annotator> classifier = in TEST_F() local
2393 ASSERT_TRUE(classifier); in TEST_F()
2397 EXPECT_THAT(classifier->ClassifyText("(555) 225-3556", {0, 14}, options), in TEST_F()
2405 std::unique_ptr<Annotator> classifier = in TEST_F() local
2408 ASSERT_TRUE(classifier); in TEST_F()
2412 EXPECT_EQ(classifier->SuggestSelection("(555) 225-3556", {6, 9}, options), in TEST_F()
2421 std::unique_ptr<Annotator> classifier = in TEST_F() local
2424 ASSERT_TRUE(classifier); in TEST_F()
2428 EXPECT_EQ(classifier->SuggestSelection("(555) 225-3556", {6, 9}, options), in TEST_F()
2438 std::unique_ptr<Annotator> classifier = in TEST_F() local
2441 ASSERT_TRUE(classifier); in TEST_F()
2443 EXPECT_THAT(classifier->Annotate("350 Third Street, Cambridge"), in TEST_F()
2445 EXPECT_EQ("address", FirstResult(classifier->ClassifyText( in TEST_F()
2447 EXPECT_EQ(classifier->SuggestSelection("350 Third Street, Cambridge", {4, 9}), in TEST_F()
2457 std::unique_ptr<Annotator> classifier = in TEST_F() local
2460 ASSERT_TRUE(classifier); in TEST_F()
2464 EXPECT_THAT(classifier->Annotate("350 Third Street, Cambridge", options), in TEST_F()
2475 std::unique_ptr<Annotator> classifier = in TEST_F() local
2478 ASSERT_TRUE(classifier); in TEST_F()
2482 EXPECT_THAT(classifier->Annotate("350 Third Street, Cambridge", options), in TEST_F()
2493 std::unique_ptr<Annotator> classifier = in TEST_F() local
2496 ASSERT_TRUE(classifier); in TEST_F()
2500 EXPECT_EQ("address", FirstResult(classifier->ClassifyText( in TEST_F()
2511 std::unique_ptr<Annotator> classifier = in TEST_F() local
2514 ASSERT_TRUE(classifier); in TEST_F()
2519 classifier->ClassifyText("350 Third Street, Cambridge", {0, 27}, options), in TEST_F()
2530 std::unique_ptr<Annotator> classifier = in TEST_F() local
2533 ASSERT_TRUE(classifier); in TEST_F()
2537 EXPECT_EQ(classifier->SuggestSelection("350 Third Street, Cambridge", {4, 9}, in TEST_F()
2549 std::unique_ptr<Annotator> classifier = in TEST_F() local
2552 ASSERT_TRUE(classifier); in TEST_F()
2556 EXPECT_EQ(classifier->SuggestSelection("350 Third Street, Cambridge", {4, 9}, in TEST_F()
2561 void VerifyClassifyTextOutputsDatetimeEntityData(const Annotator* classifier) { in VerifyClassifyTextOutputsDatetimeEntityData() argument
2562 EXPECT_TRUE(classifier); in VerifyClassifyTextOutputsDatetimeEntityData()
2567 result = classifier->ClassifyText("03.05.1970 00:00am", {0, 18}, options); in VerifyClassifyTextOutputsDatetimeEntityData()
2630 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
2632 VerifyClassifyTextOutputsDatetimeEntityData(classifier.get()); in TEST_F()
2637 std::unique_ptr<Annotator> classifier = in TEST_F() local
2640 VerifyClassifyTextOutputsDatetimeEntityData(classifier.get()); in TEST_F()
2643 void VerifyAnnotateOutputsDatetimeEntityData(const Annotator* classifier) { in VerifyAnnotateOutputsDatetimeEntityData() argument
2644 EXPECT_TRUE(classifier); in VerifyAnnotateOutputsDatetimeEntityData()
2650 result = classifier->Annotate("September 1, 2019", options); in VerifyAnnotateOutputsDatetimeEntityData()
2691 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
2693 VerifyAnnotateOutputsDatetimeEntityData(classifier.get()); in TEST_F()
2698 std::unique_ptr<Annotator> classifier = in TEST_F() local
2701 VerifyAnnotateOutputsDatetimeEntityData(classifier.get()); in TEST_F()
2709 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
2711 EXPECT_TRUE(classifier); in TEST_F()
2715 ExpectFirstEntityIsMoney(classifier->Annotate("3.5 CHF", options), "CHF", in TEST_F()
2718 ExpectFirstEntityIsMoney(classifier->Annotate("CHF 3.5", options), "CHF", in TEST_F()
2722 classifier->Annotate("For online purchase of CHF 23.00 enter", options), in TEST_F()
2726 classifier->Annotate("For online purchase of 23.00 CHF enter", options), in TEST_F()
2729 ExpectFirstEntityIsMoney(classifier->Annotate("4.8198£", options), "£", in TEST_F()
2732 ExpectFirstEntityIsMoney(classifier->Annotate("£4.8198", options), "£", in TEST_F()
2735 ExpectFirstEntityIsMoney(classifier->Annotate("$0.0255", options), "$", in TEST_F()
2738 ExpectFirstEntityIsMoney(classifier->Annotate("$0.0255", options), "$", in TEST_F()
2742 classifier->Annotate("for txn of INR 000.00 at RAZOR-PAY ZOMATO ONLINE " in TEST_F()
2748 classifier->Annotate("for txn of 000.00 INR at RAZOR-PAY ZOMATO ONLINE " in TEST_F()
2754 ExpectFirstEntityIsMoney(classifier->Annotate("35 CHF", options), "CHF", in TEST_F()
2757 ExpectFirstEntityIsMoney(classifier->Annotate("CHF 35", options), "CHF", in TEST_F()
2761 classifier->Annotate("and win back up to CHF 150 - with digitec", in TEST_F()
2766 classifier->Annotate("and win back up to 150 CHF - with digitec", in TEST_F()
2771 ExpectFirstEntityIsMoney(classifier->Annotate("3.555.333 CHF", options), in TEST_F()
2775 ExpectFirstEntityIsMoney(classifier->Annotate("CHF 3.555.333", options), in TEST_F()
2779 ExpectFirstEntityIsMoney(classifier->Annotate("10,000 CHF", options), "CHF", in TEST_F()
2782 ExpectFirstEntityIsMoney(classifier->Annotate("CHF 10,000", options), "CHF", in TEST_F()
2786 ExpectFirstEntityIsMoney(classifier->Annotate("3,555.33 CHF", options), "CHF", in TEST_F()
2789 ExpectFirstEntityIsMoney(classifier->Annotate("CHF 3,555.33", options), "CHF", in TEST_F()
2792 ExpectFirstEntityIsMoney(classifier->Annotate("$3,000.00", options), "$", in TEST_F()
2795 ExpectFirstEntityIsMoney(classifier->Annotate("3,000.00$", options), "$", in TEST_F()
2799 ExpectFirstEntityIsMoney(classifier->Annotate("1.2 CHF", options), "CHF", in TEST_F()
2802 ExpectFirstEntityIsMoney(classifier->Annotate("CHF1.2", options), "CHF", in TEST_F()
2806 ExpectFirstEntityIsMoney(classifier->Annotate("$1.123456789", options), "$", in TEST_F()
2809 ExpectFirstEntityIsMoney(classifier->Annotate("10.01 CHF", options), "CHF", in TEST_F()
2813 ExpectFirstEntityIsMoney(classifier->Annotate("$59 Million", options), "$", in TEST_F()
2816 ExpectFirstEntityIsMoney(classifier->Annotate("7.05k €", options), "€", in TEST_F()
2819 ExpectFirstEntityIsMoney(classifier->Annotate("7.123456789m €", options), "€", in TEST_F()
2822 ExpectFirstEntityIsMoney(classifier->Annotate("7.000056789k €", options), "€", in TEST_F()
2826 ExpectFirstEntityIsMoney(classifier->Annotate("$59.3 Billion", options), "$", in TEST_F()
2829 ExpectFirstEntityIsMoney(classifier->Annotate("$1.5 Billion", options), "$", in TEST_F()
2835 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
2840 classifier->SetLangId(langid_model.get()); in TEST_F()
2846 classifier->ClassifyText("hello, how are you doing?", {11, 14}, options); in TEST_F()
2852 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
2863 classifier->AnnotateStructuredInput(string_fragments, annotation_options); in TEST_F()
2874 const Annotator* classifier) { in VerifyInputFragmentTimestampOverridesAnnotationOptions() argument
2888 classifier->AnnotateStructuredInput(string_fragments, annotation_options); in VerifyInputFragmentTimestampOverridesAnnotationOptions()
2905 std::unique_ptr<Annotator> classifier = in TEST_F() local
2908 VerifyInputFragmentTimestampOverridesAnnotationOptions(classifier.get()); in TEST_F()
2912 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
2914 VerifyInputFragmentTimestampOverridesAnnotationOptions(classifier.get()); in TEST_F()
2918 const Annotator* classifier) { in VerifyInputFragmentTimezoneOverridesAnnotationOptions() argument
2929 classifier->AnnotateStructuredInput(string_fragments, annotation_options); in VerifyInputFragmentTimezoneOverridesAnnotationOptions()
2944 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
2946 VerifyInputFragmentTimezoneOverridesAnnotationOptions(classifier.get()); in TEST_F()
2952 std::unique_ptr<Annotator> classifier = in TEST_F() local
2955 VerifyInputFragmentTimezoneOverridesAnnotationOptions(classifier.get()); in TEST_F()
2983 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
2985 ASSERT_TRUE(classifier); in TEST_F()
2993 for (const AnnotatedSpan& span : classifier->Annotate(test_string, options)) { in TEST_F()
3008 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
3010 ASSERT_TRUE(classifier); in TEST_F()
3031 EXPECT_THAT(classifier->Annotate(R"--(I saw Barack Obama today in TEST_F()
3043 const Annotator* classifier) { in VerifyAnnotateSupportsPointwiseCollectionFilteringInRawMode() argument
3044 ASSERT_TRUE(classifier); in VerifyAnnotateSupportsPointwiseCollectionFilteringInRawMode()
3078 EXPECT_THAT(classifier->Annotate(example.text, options), in VerifyAnnotateSupportsPointwiseCollectionFilteringInRawMode()
3086 std::unique_ptr<Annotator> classifier = Annotator::FromPath( in TEST_F() local
3088 VerifyAnnotateSupportsPointwiseCollectionFilteringInRawMode(classifier.get()); in TEST_F()
3094 std::unique_ptr<Annotator> classifier = in TEST_F() local
3097 VerifyAnnotateSupportsPointwiseCollectionFilteringInRawMode(classifier.get()); in TEST_F()
3102 std::unique_ptr<Annotator> classifier = in TEST_F() local
3104 ASSERT_TRUE(classifier); in TEST_F()
3105 EXPECT_THAT(classifier->Annotate("(857) 225-3556"), Not(IsEmpty())); in TEST_F()
3116 std::unique_ptr<Annotator> classifier; in TEST_F() local
3123 classifier = Annotator::FromUnownedBuffer( in TEST_F()
3126 ASSERT_TRUE(classifier); in TEST_F()
3132 classifier->Annotate("let's meet in 3 hours\nbut not now", options); in TEST_F()
3144 std::unique_ptr<Annotator> classifier = in TEST_F() local
3146 ASSERT_TRUE(classifier); in TEST_F()
3147 EXPECT_THAT(classifier->Annotate(invalid_utf8_text_with_phone_number), in TEST_F()
3150 classifier->SuggestSelection(invalid_utf8_text_with_phone_number, {1, 4}), in TEST_F()
3153 classifier->ClassifyText(invalid_utf8_text_with_phone_number, {0, 14}), in TEST_F()