greedy_dict_ut.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. #include "gd_builder.h"
  2. #include <library/cpp/testing/unittest/registar.h>
  3. #include <library/cpp/string_utils/relaxed_escaper/relaxed_escaper.h>
  4. #include <util/string/printf.h>
  5. #include <util/generic/ymath.h>
  6. class TGreedyDictTest: public TTestBase {
  7. UNIT_TEST_SUITE(TGreedyDictTest);
  8. UNIT_TEST(TestEntrySet)
  9. UNIT_TEST(TestBuilder0)
  10. UNIT_TEST(TestBuilder)
  11. UNIT_TEST_SUITE_END();
  12. void TestEntrySet() {
  13. using namespace NGreedyDict;
  14. {
  15. TEntrySet d;
  16. d.InitWithAlpha();
  17. for (TEntrySet::const_iterator it = d.begin(); it != d.end(); ++it) {
  18. UNIT_ASSERT_C(!it->HasPrefix(), Sprintf("%u -> %u", it->Number, it->NearestPrefix));
  19. UNIT_ASSERT_VALUES_EQUAL(it->Number, (ui32)(it - d.begin()));
  20. }
  21. UNIT_ASSERT_VALUES_EQUAL(d.size(), 256u);
  22. TStringBuf s = "aaabbb";
  23. UNIT_ASSERT_VALUES_EQUAL(d.FindPrefix(s)->Str, "a");
  24. UNIT_ASSERT_VALUES_EQUAL(s, "aabbb");
  25. UNIT_ASSERT_VALUES_EQUAL(d.FindPrefix(s)->Str, "a");
  26. UNIT_ASSERT_VALUES_EQUAL(s, "abbb");
  27. UNIT_ASSERT_VALUES_EQUAL(d.FindPrefix(s)->Str, "a");
  28. UNIT_ASSERT_VALUES_EQUAL(s, "bbb");
  29. UNIT_ASSERT_VALUES_EQUAL(d.FindPrefix(s)->Str, "b");
  30. UNIT_ASSERT_VALUES_EQUAL(s, "bb");
  31. UNIT_ASSERT_VALUES_EQUAL(d.FindPrefix(s)->Str, "b");
  32. UNIT_ASSERT_VALUES_EQUAL(s, "b");
  33. UNIT_ASSERT_VALUES_EQUAL(d.FindPrefix(s)->Str, "b");
  34. UNIT_ASSERT_VALUES_EQUAL(s, "");
  35. s = TStringBuf("", 1);
  36. UNIT_ASSERT_VALUES_EQUAL(d.FindPrefix(s)->Str, TStringBuf("", 1));
  37. UNIT_ASSERT_VALUES_EQUAL(s, "");
  38. s = "\xFF";
  39. UNIT_ASSERT_VALUES_EQUAL(d.FindPrefix(s)->Str, "\xFF");
  40. UNIT_ASSERT_VALUES_EQUAL(s, "");
  41. }
  42. {
  43. TEntrySet d;
  44. d.Add("a");
  45. d.Add("b");
  46. d.Add("b", "a");
  47. d.BuildHierarchy();
  48. UNIT_ASSERT_VALUES_EQUAL(d.size(), 3u);
  49. TStringBuf s = "bab";
  50. UNIT_ASSERT_VALUES_EQUAL(d.FindPrefix(s)->Str, "ba");
  51. UNIT_ASSERT_VALUES_EQUAL(s, "b");
  52. }
  53. {
  54. TEntrySet d;
  55. d.Add("a");
  56. d.Add("aa");
  57. d.Add("aaa");
  58. d.Add("aab");
  59. d.Add("b");
  60. d.Add("ba");
  61. d.BuildHierarchy();
  62. UNIT_ASSERT_VALUES_EQUAL(d.size(), 6u);
  63. {
  64. TStringBuf s = "aaaaa";
  65. const TEntry* e = d.FindPrefix(s);
  66. UNIT_ASSERT_VALUES_EQUAL(e->Str, "aaa");
  67. UNIT_ASSERT_VALUES_EQUAL(e->Number, 2u);
  68. UNIT_ASSERT_VALUES_EQUAL(e->NearestPrefix, 1);
  69. UNIT_ASSERT_VALUES_EQUAL(s, "aa");
  70. }
  71. {
  72. TStringBuf s = "a";
  73. const TEntry* e = d.FindPrefix(s);
  74. UNIT_ASSERT_VALUES_EQUAL(e->Str, "a");
  75. UNIT_ASSERT_VALUES_EQUAL(e->Number, 0u);
  76. UNIT_ASSERT_VALUES_EQUAL(e->NearestPrefix, -1);
  77. UNIT_ASSERT_VALUES_EQUAL(s, "");
  78. }
  79. {
  80. TStringBuf s = "bab";
  81. const TEntry* e = d.FindPrefix(s);
  82. UNIT_ASSERT_VALUES_EQUAL(e->Str, "ba");
  83. UNIT_ASSERT_VALUES_EQUAL(e->Number, 5u);
  84. UNIT_ASSERT_VALUES_EQUAL(e->NearestPrefix, 4);
  85. UNIT_ASSERT_VALUES_EQUAL(s, "b");
  86. }
  87. {
  88. TStringBuf s = "bba";
  89. const TEntry* e = d.FindPrefix(s);
  90. UNIT_ASSERT_VALUES_EQUAL(e->Str, "b");
  91. UNIT_ASSERT_VALUES_EQUAL(e->Number, 4u);
  92. UNIT_ASSERT_VALUES_EQUAL(e->NearestPrefix, -1);
  93. UNIT_ASSERT_VALUES_EQUAL(s, "ba");
  94. }
  95. }
  96. }
  97. void TestBuilder0() {
  98. using namespace NGreedyDict;
  99. ui32 a = 1, b = 11;
  100. ui64 ab = TDictBuilder::Compose(a, b);
  101. UNIT_ASSERT(TDictBuilder::IsCompound(ab));
  102. UNIT_ASSERT_VALUES_EQUAL(TDictBuilder::Prev(ab), a);
  103. UNIT_ASSERT_VALUES_EQUAL(TDictBuilder::Next(ab), b);
  104. }
  105. void FillData(NGreedyDict::TStringBufs& data) {
  106. static const char* urls[] = {"http://53.ru/car/motors/foreign/opel/tigra/", "http://abakan.24au.ru/tender/85904/", "http://anm15.gulaig.com/", "http://avto-parts.com/mercedes-benz/mercedes-benz-w220-1998-2005/category-442/category-443/", "http://ballooncousin.co.uk/", "http://benzol.ru/equipment/?id=1211&parent=514", "http://blazingseorank.com/blazing-seo-rank-free-website-analysis-to-increase-rank-and-traffic-450.html", "http://blogblaugrana.contadorwebmasters.com/", "http://bristolhash.org.uk/bh3cntct.php", "http://broker.borovichi.ru/category/item/3/1/0/8/28/257", "http://canoncompactcamerax.blogspot.com/", "http://classifieds.smashits.com/p,107881,email-to-friend.htm", "http://conferences.ksde.org/Portals/132/FallAssessment/SAVETHEDAY-FA09.pdf", "http://eway.vn/raovat/325-dien-tu-gia-dung/337-dieu-hoa/98041-b1-sua-may-lanh-quan-binh-tan-sua-may-lanh-quan-binh-chanh-hh-979676119-toan-quoc.html", "http://gallery.e2bn.org/asset73204_8-.html", "http://goplay.nsw.gov.au/activities-for-kids/by/historic-houses-trust/?startdate=2012-07-10", "http://grichards19067.multiply.com/", "http://hotkovo.egent.ru/user/89262269084/", "http://howimetyourself.com/?redirect_to=http://gomiso.com/m/suits/seasons/2/episodes/2", "http://islamqa.com/hi/ref/9014/DEAD%20PEOPLE%20GOOD%20DEEDS", "http://lapras.rutube.ru/", "http://nceluiko.ya.ru/", "http://nyanyanyanyaa.beon.ru/", "http://ozbo.com/Leaf-River-DV-7SS-7-0-MP-Game-Camera-K1-32541.html", "http://sbantom.ru/catalog/chasy/632753.html", "http://shopingoff.com/index.php?option=com_virtuemart&Itemid=65&category_id=&page=shop.browse&manufacturer_id=122&limit=32&limitstart=96", "http://shopingoff.com/katalog-odezhdy/manufacturer/62-christian-audigier.html?limit=32&start=448", "https://webwinkel.ah.nl/process?fh_location=//ecommerce/nl_NL/categories%3C%7Becommerce_shoc1%7D/it_show_product_code_1384%3E%7B10%3B20%7D/pr_startdate%3C20120519/pr_enddate%3E20120519/pr_ltc_allowed%3E%7Bbowi%7D/categories%3C%7Becommerce_shoc1_1al%7D/categories%3C%7Becommerce_shoc1_1al_1ahal%7D&&action=albert_noscript.modules.build", "http://top100.rambler.ru/navi/?theme=208/210/371&rgn=17", "http://volgogradskaya-oblast.extra-m.ru/classifieds/rabota/vakansii/banki-investicii/901467/", "http://wikien4.appspot.com/wiki/Warburg_hypothesis", "http://wola_baranowska.kamerzysta24.com.pl/", "http://www.10dot0dot0dot1.com/", "http://www.anima-redux.ru/index.php?key=gifts+teenage+girls", "http://www.aquaticabyseaworld.com/Calendar.aspx/CP/CP/CP/sp-us/CP/CP/ParkMap/Tickets/Weather.aspx", "http://www.autousa.com/360spin/2012_cadillac_ctssportwagon_3.6awdpremiumcollection.htm", "http://www.booking.com/city/gb/paignton-aireborough.html?inac=0&lang=pl", "http://www.booking.com/city/it/vodo-cadore.en.html", "http://www.booking.com/district/us/new-york/rockefeller-center.html&lang=no", "http://www.booking.com/hotel/bg/crown-fort-club.lv.html", "http://www.booking.com/hotel/ca/gouverneur-rimouski.ar.html", "http://www.booking.com/hotel/ch/l-auberge-du-chalet-a-gobet.fi.html", "http://www.booking.com/hotel/de/mark-garni.ru.html?aid=337384;label=yandex-hotel-mark-garni-68157-%7Bparam1%7D", "http://www.booking.com/hotel/de/mercure-goldschmieding-castrop-rauxel.ro.html", "http://www.booking.com/hotel/de/zollenspieker-fahrhaus.fr.html", "http://www.booking.com/hotel/es/jardin-metropolitano.ca.html", "http://www.booking.com/hotel/fr/clim.fr.html", "http://www.booking.com/hotel/fr/radisson-sas-toulouse-airport.et.html", "http://www.booking.com/hotel/gb/stgileshotel.ro.html?srfid=68c7fe42a03653a8796c84435c5299e4X16?tab=4", "http://www.booking.com/hotel/gr/rodos-park-suites.ru.html", "http://www.booking.com/hotel/id/le-grande-suites-bali.ru.html", "http://www.booking.com/hotel/it/mozart.it.html?aid=321655", "http://www.booking.com/hotel/ni/bahia-del-sol-villas.ru.html?dcid=1;dva=0", "http://www.booking.com/hotel/nl/cpschiphol.ro.html.ro.html?tab=4", "http://www.booking.com/hotel/th/laem-din.en-gb.html", "http://www.booking.com/hotel/th/tinidee-ranong.en.html", "http://www.booking.com/hotel/us/best-western-plus-merrimack-valley.hu.html", "http://www.booking.com/hotel/vn/tan-hai-long.km.html", "http://www.booking.com/landmark/au/royal-brisbane-women-s-hospital.vi.html", "http://www.booking.com/landmark/hk/nam-cheong-station.html&lang=id", "http://www.booking.com/landmark/it/spanish-steps.ca.html", "http://www.booking.com/landmark/sg/asian-civilisations-museum.html&lang=fi", "http://www.booking.com/place/fi-1376029.pt.html", "http://www.booking.com/place/tn257337.pl.html", "http://www.booking.com/region/ca/niagarafalls.ar.html&selected_currency=PLN", "http://www.booking.com/region/mx/queretaro.pt-pt.html&selected_currency=AUD", "http://www.booking.com/searchresults.en.html?city=20063074", "http://www.booking.com/searchresults.et.html?checkin=;checkout=;city=-394632", "http://www.booking.com/searchresults.lv.html?region=3936", "http://www.cevredanismanlari.com/index.php/component/k2/index.php/mevzuat/genel-yazlar/item/dosyalar/index.php?option=com_k2&view=item&id=16:iso-14001-%C3%A7evre-y%C3%B6netim-sistemi&Itemid=132&limitstart=107120", "http://www.dh-wholesaler.com/MENS-POLO-RACING-TEE-RL-p-417.html", "http://www.employabilityonline.net/", "http://www.esso.inc.ru/board/tools.php?event=profile&pname=Invinerrq", "http://www.filesurgery.ru/searchfw/kids_clothes-3.html", "http://www.furnitureandcarpetsource.com/Item.aspx?ItemID=-2107311899&ItemNum=53-T3048", "http://www.gets.cn/product/Gold-Sand-Lampwork-Glass-Beads--Flat-round--28x28x13mm_p260717.html", "http://www.gets.cn/wholesale-Sterling-Silver-Pendant-Findings-3577_S--L-Star-P-1.html?view=1&by=1", "http://www.homeandgardenadvice.com/diy/Mortgages_Loans_and_Financing/9221.html", "http://www.hongkongairport.com/eng/index.html/passenger/passenger/transport/to-from-airport/business/about-the-airport/transport/shopping/entertainment/t2/passenger/interactive-map.html", "http://www.hongkongairport.com/eng/index.html/shopping/insideshopping/all/passenger/transfer-transit/all/airline-information/shopping/entertainment/t2/business/about-the-airport/welcome.html", "http://www.hongkongairport.com/eng/index.html/transport/business/about-the-airport/transport/business/airport-authority/passenger/shopping/dining/all/dining.html", "http://www.idedge.com/index.cfm/fuseaction/category.display/category_id/298/index.cfm", "http://www.istanbulburda.com/aramalar.php", "http://www.jewelryinthenet.com/ads/AdDetail.aspx?AdID=1-0311002490689&stid=22-0111001020877", "http://www.johnnydepp.ru/forum/index.php?showtopic=1629&mode=linearplus&view=findpost&p=186977", "http://www.johnnydepp.ru/forum/index.php?showtopic=476&st=60&p=87379&", "http://www.joseleano.com/joomla/index.php/audio", "http://www.kaplicarehberi.com/tag/sakar-ilicali-kaplicalari/feed", "http://www.khaber.com.tr/arama.html?key=%C3%A7avdar", "http://www.kiz-oyunlari1.com/1783/4437/4363/1056/4170/Bump-Copter2-.html", "http://www.kiz-oyunlari1.com/3752/2612/4175/1166/3649/1047/Angelina-Oyunu.html", "http://www.kiz-oyunlari1.com/4266/3630/3665/3286/4121/301/3274/Sinir-Sinekler-.html", "http://www.kuldiga.lv/index.php?f=8&cat=371", "http://www.kuldiga.lv/index.php/img/index.php?l=lv&art_id=1836&show_c=&cat=85", "http://www.patronessa.ru/remontiruemsya/kuzovnie30raboti.html", "http://www.rapdict.org/Nu_Money?title=Talk:Nu_Money&action=edit", "http://www.serafin-phu.tabor24.com/?page=8", "http://www.shoes-store.org/brand1/Kids/Minnetonka.html", "http://www.shoes-store.org/shoes-store.xml", "http://www.way2allah.com/khotab-download-34695.htm"};
  107. data.clear();
  108. data.insert(data.begin(), urls, urls + Y_ARRAY_SIZE(urls));
  109. }
  110. typedef THashMap<TStringBuf, NGreedyDict::TEntry> TDict;
  111. TAutoPtr<NGreedyDict::TEntrySet> DoTestBuilder(const NGreedyDict::TBuildSettings& s,
  112. TDict& res) {
  113. using namespace NGreedyDict;
  114. TStringBufs data;
  115. FillData(data);
  116. TDictBuilder b(s);
  117. b.SetInput(data);
  118. b.Build(256 + 128);
  119. TEntrySet& set = b.EntrySet();
  120. for (const auto& it : set) {
  121. if (it.Score) {
  122. res[it.Str] = it;
  123. }
  124. }
  125. return b.ReleaseEntrySet();
  126. }
  127. void DoAssertEntry(TStringBuf entry, ui32 number, i32 parent, float score, const TDict& dict) {
  128. TDict::const_iterator it = dict.find(entry);
  129. UNIT_ASSERT_C(it != dict.end(), entry);
  130. UNIT_ASSERT_VALUES_EQUAL_C(it->second.Number, number, entry);
  131. UNIT_ASSERT_VALUES_EQUAL_C(it->second.NearestPrefix, parent, entry);
  132. UNIT_ASSERT_VALUES_EQUAL_C(round(it->second.Score * 10000), round(score * 10000), entry);
  133. }
  134. void TestBuilder() {
  135. TAutoPtr<NGreedyDict::TEntrySet> set;
  136. THashMap<TStringBuf, NGreedyDict::TEntry> res;
  137. NGreedyDict::TBuildSettings s;
  138. set = DoTestBuilder(s, res);
  139. UNIT_ASSERT_VALUES_EQUAL(set->size(), 295u);
  140. UNIT_ASSERT_VALUES_EQUAL(res.size(), 110u);
  141. DoAssertEntry("%", 37, -1, 0.00375193, res);
  142. DoAssertEntry("%7", 38, 37, 0.00513299, res);
  143. DoAssertEntry("&", 39, -1, 0.00794527, res);
  144. DoAssertEntry("+", 44, -1, 0.000441404, res);
  145. DoAssertEntry(",", 45, -1, 0.000441404, res);
  146. DoAssertEntry("-", 46, -1, 0.0417126, res);
  147. DoAssertEntry(".", 47, -1, 0.0196425, res);
  148. DoAssertEntry(".com/", 48, 47, 0.0374482, res);
  149. DoAssertEntry(".html", 49, 47, 0.0496577, res);
  150. DoAssertEntry(".html?", 50, 49, 0.0153908, res);
  151. DoAssertEntry(".php", 51, 47, 0.0123585, res);
  152. DoAssertEntry(".ru/", 52, 47, 0.0150027, res);
  153. DoAssertEntry("/", 53, -1, 0.0452439, res);
  154. DoAssertEntry("/index", 54, 53, 0.0158905, res);
  155. DoAssertEntry("0", 55, -1, 0.00816597, res);
  156. DoAssertEntry("1", 56, -1, 0.0167733, res);
  157. DoAssertEntry("10", 57, 56, 0.00530474, res);
  158. DoAssertEntry("2", 58, -1, 0.0101523, res);
  159. DoAssertEntry("20", 59, 58, 0.00674234, res);
  160. DoAssertEntry("3", 60, -1, 0.01258, res);
  161. DoAssertEntry("32", 61, 60, 0.00490697, res);
  162. DoAssertEntry("4", 62, -1, 0.00993158, res);
  163. DoAssertEntry("5", 63, -1, 0.00617965, res);
  164. DoAssertEntry("6", 64, -1, 0.00971088, res);
  165. DoAssertEntry("7", 65, -1, 0.0101523, res);
  166. DoAssertEntry("8", 66, -1, 0.00728316, res);
  167. DoAssertEntry("9", 67, -1, 0.00728316, res);
  168. DoAssertEntry(":", 68, -1, 0.000662106, res);
  169. DoAssertEntry(";", 69, -1, 0.000882807, res);
  170. DoAssertEntry("=", 71, -1, 0.01258, res);
  171. DoAssertEntry("?", 73, -1, 0.00397263, res);
  172. DoAssertEntry("A", 75, -1, 0.00264842, res);
  173. DoAssertEntry("B", 76, -1, 0.00220702, res);
  174. DoAssertEntry("C", 77, -1, 0.00353123, res);
  175. DoAssertEntry("D", 78, -1, 0.00375193, res);
  176. DoAssertEntry("E", 79, -1, 0.00286912, res);
  177. DoAssertEntry("F", 80, -1, 0.00110351, res);
  178. DoAssertEntry("G", 81, -1, 0.00110351, res);
  179. DoAssertEntry("H", 82, -1, 0.000220702, res);
  180. DoAssertEntry("I", 83, -1, 0.00198632, res);
  181. DoAssertEntry("K", 85, -1, 0.000441404, res);
  182. DoAssertEntry("L", 86, -1, 0.00198632, res);
  183. DoAssertEntry("M", 87, -1, 0.00154491, res);
  184. DoAssertEntry("N", 88, -1, 0.00154491, res);
  185. DoAssertEntry("O", 89, -1, 0.00132421, res);
  186. DoAssertEntry("P", 90, -1, 0.00308983, res);
  187. DoAssertEntry("R", 92, -1, 0.000662106, res);
  188. DoAssertEntry("S", 93, -1, 0.00264842, res);
  189. DoAssertEntry("T", 94, -1, 0.00110351, res);
  190. DoAssertEntry("U", 95, -1, 0.000220702, res);
  191. DoAssertEntry("V", 96, -1, 0.000441404, res);
  192. DoAssertEntry("W", 97, -1, 0.000441404, res);
  193. DoAssertEntry("X", 98, -1, 0.000220702, res);
  194. DoAssertEntry("Y", 99, -1, 0.000220702, res);
  195. DoAssertEntry("_", 105, -1, 0.00904877, res);
  196. DoAssertEntry("a", 107, -1, 0.0505407, res);
  197. DoAssertEntry("an", 108, 107, 0.018273, res);
  198. DoAssertEntry("ar", 109, 107, 0.0169385, res);
  199. DoAssertEntry("b", 110, -1, 0.0156698, res);
  200. DoAssertEntry("c", 111, -1, 0.018539, res);
  201. DoAssertEntry("cat", 112, 111, 0.00846732, res);
  202. DoAssertEntry("ch", 113, 111, 0.00644872, res);
  203. DoAssertEntry("com", 114, 111, 0.00724235, res);
  204. DoAssertEntry("ct", 115, 111, 0.00605729, res);
  205. DoAssertEntry("d", 116, -1, 0.020746, res);
  206. DoAssertEntry("di", 117, 116, 0.00730659, res);
  207. DoAssertEntry("e", 118, -1, 0.0624586, res);
  208. DoAssertEntry("en", 119, 118, 0.0108999, res);
  209. DoAssertEntry("ent", 120, 119, 0.00616002, res);
  210. DoAssertEntry("f", 121, -1, 0.00860737, res);
  211. DoAssertEntry("fi", 122, 121, 0.00423196, res);
  212. DoAssertEntry("g", 123, -1, 0.0180975, res);
  213. DoAssertEntry("go", 124, 123, 0.00601862, res);
  214. DoAssertEntry("h", 125, -1, 0.010373, res);
  215. DoAssertEntry("ho", 126, 125, 0.00570298, res);
  216. DoAssertEntry("http://", 127, 125, 0.0494372, res);
  217. DoAssertEntry("http://www.", 128, 127, 0.0849702, res);
  218. DoAssertEntry("http://www.booking.com/", 129, 128, 0.071066, res);
  219. DoAssertEntry("http://www.booking.com/hotel/", 130, 129, 0.121607, res);
  220. DoAssertEntry("i", 131, -1, 0.0258221, res);
  221. DoAssertEntry("id=", 132, 131, 0.00725369, res);
  222. DoAssertEntry("im", 133, 131, 0.00373318, res);
  223. DoAssertEntry("in", 134, 131, 0.013625, res);
  224. DoAssertEntry("ing", 135, 134, 0.00795491, res);
  225. DoAssertEntry("ion", 136, 131, 0.00796149, res);
  226. DoAssertEntry("it", 137, 131, 0.00953416, res);
  227. DoAssertEntry("j", 138, -1, 0.00132421, res);
  228. DoAssertEntry("k", 139, -1, 0.0134628, res);
  229. DoAssertEntry("l", 140, -1, 0.0381814, res);
  230. DoAssertEntry("m", 141, -1, 0.0174354, res);
  231. DoAssertEntry("mer", 142, 141, 0.00711846, res);
  232. DoAssertEntry("n", 143, -1, 0.0132421, res);
  233. DoAssertEntry("o", 144, -1, 0.0302362, res);
  234. DoAssertEntry("on", 145, 144, 0.00802271, res);
  235. DoAssertEntry("ou", 146, 144, 0.00414545, res);
  236. DoAssertEntry("p", 147, -1, 0.0225116, res);
  237. DoAssertEntry("port", 148, 147, 0.0123532, res);
  238. DoAssertEntry("q", 149, -1, 0.00176561, res);
  239. DoAssertEntry("r", 150, -1, 0.0401677, res);
  240. DoAssertEntry("ran", 151, 150, 0.00686918, res);
  241. DoAssertEntry("s", 152, -1, 0.0487751, res);
  242. DoAssertEntry("sho", 153, 152, 0.0113876, res);
  243. DoAssertEntry("t", 154, -1, 0.0379607, res);
  244. DoAssertEntry("u", 155, -1, 0.0211874, res);
  245. DoAssertEntry("v", 156, -1, 0.00595895, res);
  246. DoAssertEntry("vi", 157, 156, 0.00480673, res);
  247. DoAssertEntry("w", 158, -1, 0.00816597, res);
  248. DoAssertEntry("x", 159, -1, 0.00375193, res);
  249. DoAssertEntry("y", 160, -1, 0.0130214, res);
  250. DoAssertEntry("z", 161, -1, 0.00353123, res);
  251. }
  252. };
  253. UNIT_TEST_SUITE_REGISTRATION(TGreedyDictTest);