@delali/narsil 0.3.1-next.157 → 0.3.1-next.161
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/filesystem.mjs +3 -3
- package/dist/adapters/gcs.mjs +3 -3
- package/dist/adapters/indexeddb.mjs +1 -1
- package/dist/adapters/s3.mjs +3 -3
- package/dist/browser/{chunk-N23GL72Q.mjs → chunk-4RNSFVWI.mjs} +20777 -19056
- package/dist/browser/chunk-MMHIIL5B.mjs +564 -0
- package/dist/browser/chunk-MZHQ65VI.mjs +1228 -0
- package/dist/browser/chunk-WC2DEXWU.mjs +29 -0
- package/dist/browser/{chunk-VLJQW4J6.mjs → core-leaf-TJAGWPZZ.mjs} +4674 -3102
- package/dist/{react-native/chunks/durability-config-QXVZEO7T.mjs → browser/durability-config-SGB5ZP5K.mjs} +8 -3
- package/dist/browser/embed-RF2MPGAO.mjs +222 -0
- package/dist/{react-native/chunks/geo-index-PX3BIHAH.mjs → browser/geo-index-GNHY4PUB.mjs} +190 -93
- package/dist/{react-native/chunks/module-TTEVPRCW.mjs → browser/module-362VSIGR.mjs} +1570 -275
- package/dist/browser/msgpack-leaf-44XNWSSY.mjs +302 -0
- package/dist/browser/optional-reads-XMVPG6HG.mjs +3230 -0
- package/dist/browser/optional-writes-WMZX4OEC.mjs +3196 -0
- package/dist/browser/phrase-module-22TKMXWI.mjs +616 -0
- package/dist/browser/resolve-vector-text-KI65IHMD.mjs +60 -0
- package/dist/browser/{restore-hooks-IE3GGYHG.mjs → restore-queue-S4BWOGMU.mjs} +98 -24
- package/dist/{react-native/chunks/runtime-R5E3TB3J.mjs → browser/runtime-NU6VOVH2.mjs} +61 -25
- package/dist/browser/segment-codec-leaf-A427QJUX.mjs +554 -0
- package/dist/browser/segment-merge-leaf-7BZ54JPI.mjs +1636 -0
- package/dist/browser/storage-leaf-X6CNRHJS.mjs +18221 -0
- package/dist/browser/store-leaf-AEMTAVHX.mjs +2069 -0
- package/dist/browser/{chunk-GFAZPSWK.mjs → suggestions-leaf-3Y6MR6OF.mjs} +441 -119
- package/dist/browser/worker-copies-WQCPP3TS.mjs +2750 -0
- package/dist/{capabilities-D3AoBJoF.d.ts → capabilities-BKDrry0z.d.ts} +2 -2
- package/dist/chunk-2JRERUNZ.mjs +217 -0
- package/dist/chunk-2RIS76RJ.mjs +212 -0
- package/dist/chunk-3B775F3C.mjs +252 -0
- package/dist/{chunk-24FNVRKB.mjs → chunk-3D6RZGJH.mjs} +3 -3
- package/dist/{chunk-INJYO3BU.mjs → chunk-4CAMH7FO.mjs} +1 -1
- package/dist/{chunk-U476IXKQ.mjs → chunk-4PY4JYMY.mjs} +2 -1
- package/dist/chunk-6EZW2GQL.mjs +978 -0
- package/dist/chunk-75UNINFA.mjs +271 -0
- package/dist/chunk-77AUVDQ5.mjs +7 -0
- package/dist/{chunk-JTYPJF3T.mjs → chunk-7MWYORQC.mjs} +2 -2
- package/dist/{chunk-TGP5M5R7.mjs → chunk-7T4LAYT4.mjs} +1 -1
- package/dist/{chunk-XIHUI4KB.mjs → chunk-AB27FWZM.mjs} +8 -3
- package/dist/{chunk-FUD5XSZ5.mjs → chunk-BXM7XM4G.mjs} +7 -3
- package/dist/{chunk-HJJI72X7.mjs → chunk-C7YQHCSO.mjs} +1 -1
- package/dist/{chunk-RVGRFOGN.mjs → chunk-D456ZFPQ.mjs} +2 -1
- package/dist/{chunk-KKQC526K.mjs → chunk-E2F6LZR3.mjs} +19 -21
- package/dist/{chunk-SMOOSIAW.mjs → chunk-FE3MRIBN.mjs} +104 -13
- package/dist/{chunk-KYYABCSW.mjs → chunk-FETZYCH7.mjs} +15 -1
- package/dist/{chunk-XXJZMTZT.mjs → chunk-FVZ5DB6Y.mjs} +3 -2
- package/dist/{chunk-EYD7K3H6.mjs → chunk-GF4K7IUK.mjs} +317 -120
- package/dist/chunk-GXCDWLQI.mjs +193 -0
- package/dist/{chunk-IIRIG7H5.mjs → chunk-H64YDF5M.mjs} +3 -3
- package/dist/{browser/chunk-VY5KW3HN.mjs → chunk-HOOR4CP5.mjs} +63 -7
- package/dist/chunk-IB4BYLE3.mjs +127 -0
- package/dist/{chunk-3C7MTCCI.mjs → chunk-IE3Q62QD.mjs} +2 -2
- package/dist/chunk-IH3G6SJO.mjs +40 -0
- package/dist/chunk-JV74RKCY.mjs +3041 -0
- package/dist/{chunk-ZPZ3YGXV.mjs → chunk-K67I3RF4.mjs} +261 -101
- package/dist/chunk-KLVMK3R5.mjs +47 -0
- package/dist/{chunk-5VV4R6P7.mjs → chunk-LAWIJRMJ.mjs} +4154 -2577
- package/dist/chunk-LF4GB4PO.mjs +281 -0
- package/dist/chunk-NC4QLCZC.mjs +59 -0
- package/dist/chunk-OOO54OVC.mjs +627 -0
- package/dist/chunk-OUWZKNO3.mjs +207 -0
- package/dist/{chunk-FJKKCV4D.mjs → chunk-P5YLI5ED.mjs} +343 -182
- package/dist/{chunk-4ZTHGTVX.mjs → chunk-PTTMGRG5.mjs} +9 -10
- package/dist/{react-native/chunks/chunk-DZ7H7D2C.mjs → chunk-Q3ZZH5Z7.mjs} +6 -0
- package/dist/{browser/chunk-EKMGCRSR.mjs → chunk-QBVTYY4J.mjs} +2 -9
- package/dist/{chunk-W5EB5XKI.mjs → chunk-R4CE4IVU.mjs} +341 -183
- package/dist/chunk-S2POFTLN.mjs +10 -0
- package/dist/{chunk-KJ3RTZDJ.mjs → chunk-S3BSDBF7.mjs} +10 -3
- package/dist/{chunk-4LMSZAK6.mjs → chunk-SHGN3QIF.mjs} +69 -13
- package/dist/chunk-SXIRM4MX.mjs +3549 -0
- package/dist/{chunk-TBC3XUL2.mjs → chunk-TGPKS2UM.mjs} +47 -1
- package/dist/chunk-TINW4BSH.mjs +31301 -0
- package/dist/{cold-module-VOJXMNZB.mjs → chunk-TSLV5P2J.mjs} +397 -80
- package/dist/{chunk-HHBUCIUY.mjs → chunk-TW543F33.mjs} +3 -3
- package/dist/chunk-U6B7DUQW.mjs +788 -0
- package/dist/{chunk-OQLD2BSW.mjs → chunk-V3SGPXWQ.mjs} +8 -9
- package/dist/chunk-W34VJXY7.mjs +4723 -0
- package/dist/chunk-YETKPX5M.mjs +5 -0
- package/dist/chunk-ZQ6QY42L.mjs +59 -0
- package/dist/{client-kqSMevVi.d.ts → client-CTp8RRiK.d.ts} +4 -4
- package/dist/client.d.ts +8 -8
- package/dist/client.mjs +66 -18
- package/dist/{config-B4v_Htpu.d.ts → config-PCNzWjHL.d.ts} +6 -3
- package/dist/{config-CTP01fns.d.ts → config-_WT5grSL.d.ts} +3 -3
- package/dist/core-leaf-KXFGP74A.mjs +7 -0
- package/dist/digest-leaf-KXBGKYHZ.mjs +1 -0
- package/dist/direct-executor-MKTZBR26.mjs +16 -0
- package/dist/distribution/coordinator/etcd.d.ts +2 -2
- package/dist/distribution/coordinator/etcd.mjs +7 -4
- package/dist/distribution/coordinator/in-memory.d.ts +2 -2
- package/dist/distribution/coordinator/in-memory.mjs +1 -2
- package/dist/distribution/transport/grpc.mjs +7 -2
- package/dist/distribution/transport/tcp.mjs +7 -1
- package/dist/distribution.d.ts +7 -7
- package/dist/distribution.mjs +1199 -1092
- package/dist/{browser/durability-config-TIYKW6XX.mjs → durability-config-XV4XR7Y4.mjs} +7 -3
- package/dist/embed-4H7RTBVL.mjs +221 -0
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{engine-CkPn2PWE.d.ts → engine-DBRVR_d-.d.ts} +1252 -1239
- package/dist/{browser/geo-index-OTV7VPIR.mjs → geo-index-2ZMMWWSK.mjs} +190 -93
- package/dist/{index-C4AmUnl1.d.ts → index-Ck9w5WHz.d.ts} +1 -1
- package/dist/index.browser.mjs +4 -16
- package/dist/index.d.ts +1495 -78
- package/dist/index.mjs +14 -50
- package/dist/index.react-native.mjs +11 -28
- package/dist/invalidation/filesystem.mjs +1 -2
- package/dist/languages/albanian.mjs +1 -1
- package/dist/languages/amharic.mjs +1 -1
- package/dist/languages/arabic.mjs +1 -1
- package/dist/languages/armenian.mjs +1 -1
- package/dist/languages/azerbaijani.mjs +1 -1
- package/dist/languages/bambara.mjs +1 -1
- package/dist/languages/basque.mjs +1 -1
- package/dist/languages/belarusian.mjs +1 -1
- package/dist/languages/bengali.mjs +1 -1
- package/dist/languages/bosnian.mjs +1 -1
- package/dist/languages/breton.mjs +1 -1
- package/dist/languages/bulgarian.mjs +1 -1
- package/dist/languages/burmese.mjs +1 -1
- package/dist/languages/catalan.mjs +1 -1
- package/dist/languages/chinese.mjs +1 -1
- package/dist/languages/croatian.mjs +1 -1
- package/dist/languages/czech.mjs +1 -1
- package/dist/languages/dagbani.mjs +1 -1
- package/dist/languages/danish.mjs +1 -1
- package/dist/languages/dutch.mjs +1 -1
- package/dist/languages/english.mjs +1 -1
- package/dist/languages/esperanto.mjs +1 -1
- package/dist/languages/estonian.mjs +1 -1
- package/dist/languages/ewe.mjs +1 -1
- package/dist/languages/faroese.mjs +1 -1
- package/dist/languages/fijian.mjs +1 -1
- package/dist/languages/finnish.mjs +1 -1
- package/dist/languages/french.mjs +1 -1
- package/dist/languages/ga.mjs +1 -1
- package/dist/languages/galician.mjs +1 -1
- package/dist/languages/georgian.mjs +1 -1
- package/dist/languages/german.mjs +1 -1
- package/dist/languages/greek.mjs +1 -1
- package/dist/languages/guarani.mjs +1 -1
- package/dist/languages/gujarati.mjs +1 -1
- package/dist/languages/haitian-creole.mjs +1 -1
- package/dist/languages/hausa.mjs +1 -1
- package/dist/languages/hawaiian.mjs +1 -1
- package/dist/languages/hebrew.mjs +1 -1
- package/dist/languages/hindi.mjs +1 -1
- package/dist/languages/hungarian.mjs +1 -1
- package/dist/languages/icelandic.mjs +1 -1
- package/dist/languages/igbo.mjs +1 -1
- package/dist/languages/indonesian.mjs +1 -1
- package/dist/languages/irish.mjs +1 -1
- package/dist/languages/italian.mjs +1 -1
- package/dist/languages/japanese.mjs +1 -1
- package/dist/languages/kannada.mjs +1 -1
- package/dist/languages/kazakh.mjs +1 -1
- package/dist/languages/khmer.mjs +1 -1
- package/dist/languages/kinyarwanda.mjs +1 -1
- package/dist/languages/kirundi.mjs +1 -1
- package/dist/languages/korean.mjs +1 -1
- package/dist/languages/kurmanji.mjs +1 -1
- package/dist/languages/kyrgyz.mjs +1 -1
- package/dist/languages/lao.mjs +1 -1
- package/dist/languages/latin.mjs +1 -1
- package/dist/languages/latvian.mjs +1 -1
- package/dist/languages/lingala.mjs +1 -1
- package/dist/languages/lithuanian.mjs +1 -1
- package/dist/languages/luxembourgish.mjs +1 -1
- package/dist/languages/macedonian.mjs +1 -1
- package/dist/languages/malagasy.mjs +1 -1
- package/dist/languages/malay.mjs +1 -1
- package/dist/languages/malayalam.mjs +1 -1
- package/dist/languages/maltese.mjs +1 -1
- package/dist/languages/maori.mjs +1 -1
- package/dist/languages/marathi.mjs +1 -1
- package/dist/languages/nepali.mjs +1 -1
- package/dist/languages/norwegian.mjs +1 -1
- package/dist/languages/oromo.mjs +1 -1
- package/dist/languages/persian.mjs +1 -1
- package/dist/languages/polish.mjs +1 -1
- package/dist/languages/portuguese.mjs +1 -1
- package/dist/languages/punjabi.mjs +1 -1
- package/dist/languages/romanian.mjs +1 -1
- package/dist/languages/russian.mjs +1 -1
- package/dist/languages/samoan.mjs +1 -1
- package/dist/languages/sanskrit.mjs +1 -1
- package/dist/languages/scottish-gaelic.mjs +1 -1
- package/dist/languages/serbian.mjs +1 -1
- package/dist/languages/shona.mjs +1 -1
- package/dist/languages/sinhala.mjs +1 -1
- package/dist/languages/slovak.mjs +1 -1
- package/dist/languages/slovenian.mjs +1 -1
- package/dist/languages/sorani.mjs +1 -1
- package/dist/languages/spanish.mjs +1 -1
- package/dist/languages/swahili.mjs +1 -1
- package/dist/languages/swedish.mjs +1 -1
- package/dist/languages/tagalog.mjs +1 -1
- package/dist/languages/tamil.mjs +1 -1
- package/dist/languages/tatar.mjs +1 -1
- package/dist/languages/telugu.mjs +1 -1
- package/dist/languages/thai.mjs +1 -1
- package/dist/languages/tibetan.mjs +1 -1
- package/dist/languages/tigrinya.mjs +1 -1
- package/dist/languages/tongan.mjs +1 -1
- package/dist/languages/turkish.mjs +1 -1
- package/dist/languages/twi.mjs +1 -1
- package/dist/languages/ukrainian.mjs +1 -1
- package/dist/languages/urdu.mjs +1 -1
- package/dist/languages/vietnamese.mjs +1 -1
- package/dist/languages/welsh.mjs +1 -1
- package/dist/languages/wolof.mjs +1 -1
- package/dist/languages/xhosa.mjs +1 -1
- package/dist/languages/yoruba.mjs +1 -1
- package/dist/languages/zulu.mjs +1 -1
- package/dist/{long-query-thread-QDFQSJD6.mjs → long-query-thread-JMGNGF6V.mjs} +74 -58
- package/dist/{module-N55W4Q5C.mjs → module-ZJ6ARG6V.mjs} +444 -111
- package/dist/msgpack-leaf-5WFRP6JM.mjs +9 -0
- package/dist/optional-reads-BR3BOVZW.mjs +3373 -0
- package/dist/optional-writes-DDFHYUOH.mjs +218 -0
- package/dist/{paged-partition-archive-RLRGOXDX.mjs → paged-partition-archive-G576XGVE.mjs} +29 -69
- package/dist/partial-words.browser.mjs +1649 -0
- package/dist/partial-words.mjs +15 -14
- package/dist/{chunk-CITFCZKF.mjs → pattern.browser.mjs} +153 -186
- package/dist/pattern.mjs +6 -8
- package/dist/persistence/durability/checkpoint-worker.d.ts +32 -24
- package/dist/persistence/durability/checkpoint-worker.mjs +27 -59
- package/dist/phrase-module-XK3T44VU.mjs +634 -0
- package/dist/query-actions-OMXJEC2J.mjs +118 -0
- package/dist/query-suggestions/merge-worker.mjs +18 -54
- package/dist/query-suggestions.browser.mjs +26 -227
- package/dist/query-suggestions.d.ts +2 -2
- package/dist/query-suggestions.mjs +16 -67
- package/dist/react-native/chunks/chunk-4EXKQ2IB.mjs +565 -0
- package/dist/react-native/chunks/chunk-52QD7CBJ.mjs +52 -0
- package/dist/react-native/chunks/chunk-72OKYHZL.mjs +969 -0
- package/dist/react-native/chunks/chunk-AQOWRH2C.mjs +802 -0
- package/dist/react-native/chunks/{chunk-4COWCEY7.mjs → chunk-FTQ7JNMU.mjs} +341 -180
- package/dist/react-native/chunks/chunk-G3CUQ333.mjs +42 -0
- package/dist/react-native/chunks/{chunk-EJ33LCHV.mjs → chunk-HRDMIQ63.mjs} +53 -1
- package/dist/react-native/chunks/{chunk-4AV5PPH6.mjs → chunk-IY6U6HRA.mjs} +63 -7
- package/dist/react-native/chunks/chunk-J2NQW353.mjs +212 -0
- package/dist/react-native/chunks/chunk-L4R5ITVG.mjs +29047 -0
- package/dist/react-native/chunks/{chunk-OXM66LO6.mjs → chunk-OK3WUA6N.mjs} +2 -10
- package/dist/react-native/chunks/{chunk-MVXELMJX.mjs → chunk-PVMEHBQO.mjs} +1 -1
- package/dist/{browser/chunk-SRMZXJSL.mjs → react-native/chunks/chunk-TQ26BKBH.mjs} +6 -0
- package/dist/{browser/chunk-GPPOG6PT.mjs → react-native/chunks/chunk-VUJCSQG5.mjs} +3 -1
- package/dist/react-native/chunks/{chunk-ENLMYKSX.mjs → chunk-XEGKQKLY.mjs} +5385 -3114
- package/dist/react-native/chunks/chunk-YOTP2FPE.mjs +232 -0
- package/dist/react-native/chunks/chunk-ZIU6TWXG.mjs +127 -0
- package/dist/react-native/chunks/core-leaf-5B4JXCVA.mjs +6 -0
- package/dist/react-native/chunks/digest-leaf-X6OIFDIU.mjs +1 -0
- package/dist/{durability-config-GE4U7MCZ.mjs → react-native/chunks/durability-config-3IOXIPYZ.mjs} +7 -3
- package/dist/react-native/chunks/embed-3WQ2CCR5.mjs +221 -0
- package/dist/{geo-index-MRH5JMIR.mjs → react-native/chunks/geo-index-QEYKEVPH.mjs} +190 -93
- package/dist/react-native/chunks/{chunk-CKNRFDTZ.mjs → gzip.react-native-DLO4WW27.mjs} +2 -1
- package/dist/{browser/module-TCT66FWA.mjs → react-native/chunks/module-VUA27HZZ.mjs} +1018 -540
- package/dist/react-native/chunks/msgpack-leaf-TR66ZVAX.mjs +7 -0
- package/dist/react-native/chunks/optional-reads-WDTLLHUT.mjs +3364 -0
- package/dist/react-native/chunks/optional-writes-FZV3QW34.mjs +267 -0
- package/dist/react-native/chunks/phrase-module-KCQWVXYZ.mjs +635 -0
- package/dist/react-native/chunks/resolve-vector-text-LXRYXF7M.mjs +59 -0
- package/dist/react-native/chunks/restore-queue-EI2V2I4S.mjs +179 -0
- package/dist/{browser/runtime-OTAGEFQW.mjs → react-native/chunks/runtime-BUCSAK4U.mjs} +61 -25
- package/dist/react-native/chunks/segment-codec-leaf-6ULP7H3I.mjs +12 -0
- package/dist/react-native/chunks/segment-merge-leaf-F4GQZNK6.mjs +13 -0
- package/dist/react-native/chunks/storage-leaf-OAXBU2L6.mjs +18042 -0
- package/dist/react-native/chunks/store-leaf-GY2ZZFXB.mjs +14 -0
- package/dist/react-native/chunks/{chunk-WW2X2AEI.mjs → suggestions-leaf-SQEZ4IBS.mjs} +332 -118
- package/dist/react-native/chunks/worker-copies-EEHSCFJW.mjs +2627 -0
- package/dist/react-native/partial-words.mjs +954 -35
- package/dist/react-native/pattern.mjs +238 -111
- package/dist/react-native/query-suggestions.mjs +33 -239
- package/dist/react-native/sync.mjs +95 -52
- package/dist/react-native/synonyms.mjs +256 -112
- package/dist/react.d.ts +9 -9
- package/dist/react.mjs +6 -0
- package/dist/{rerank-MQ37IYRV.mjs → rerank-Y6MWBMTT.mjs} +17 -8
- package/dist/rerankers/http.mjs +2 -2
- package/dist/resolve-vector-text-4PDRTPNQ.mjs +2 -0
- package/dist/restore-queue-KPYSRJ4A.mjs +184 -0
- package/dist/runtime-4GKUIAKV.mjs +595 -0
- package/dist/{schema-Jwt928nJ.d.ts → schema-C_7yRJLt.d.ts} +1 -1
- package/dist/segment-codec-leaf-6IFBSBPN.mjs +17 -0
- package/dist/segment-merge-leaf-VE3FUSVE.mjs +17 -0
- package/dist/server.d.ts +33 -13
- package/dist/server.mjs +81 -100
- package/dist/{browser/durability-wiring-GVZEE46O.mjs → storage-leaf-HMIIOUYN.mjs} +2334 -931
- package/dist/store-leaf-M7T7SUZJ.mjs +19 -0
- package/dist/stored-values-BWIMpiT_.d.ts +25 -0
- package/dist/suggestions-leaf-Q3Q5D6XV.mjs +53 -0
- package/dist/sync/filesystem.d.ts +3 -3
- package/dist/sync/filesystem.mjs +27 -11
- package/dist/sync/indexeddb.browser.mjs +287 -0
- package/dist/sync/indexeddb.d.ts +3 -3
- package/dist/sync/indexeddb.mjs +7 -2
- package/dist/sync.browser.mjs +88 -72
- package/dist/sync.d.ts +4 -4
- package/dist/sync.mjs +89 -59
- package/dist/{chunk-I5B7RXU7.mjs → synonyms.browser.mjs} +248 -135
- package/dist/synonyms.mjs +15 -11
- package/dist/{tasks-CoNjxbop.d.ts → tasks-B4tT4vmP.d.ts} +4 -4
- package/dist/thread-SNILJXX3.mjs +30 -0
- package/dist/{types-DPMjfOr_.d.ts → types-CTg0KaMy.d.ts} +2 -2
- package/dist/vector/search-worker.d.ts +7 -1
- package/dist/vector/search-worker.mjs +9 -13
- package/dist/worker-copies-ZLZS2CUM.mjs +2152 -0
- package/dist/workers/entry.mjs +60 -30
- package/openapi.json +66 -50
- package/package.json +233 -8
- package/dist/analysis-change-CKEMM2MC.mjs +0 -55
- package/dist/analysis-change-entry-SEDMJ6MW.mjs +0 -1
- package/dist/archive-history-E4R73RWD.mjs +0 -29
- package/dist/browser/analysis-change-ZKGJFENM.mjs +0 -942
- package/dist/browser/analysis-change-entry-5BFUVMHJ.mjs +0 -1
- package/dist/browser/archive-history-4IP5XQZY.mjs +0 -29
- package/dist/browser/chunk-25MTVDYD.mjs +0 -432
- package/dist/browser/chunk-3I27KXQD.mjs +0 -34
- package/dist/browser/chunk-3NLMB5CC.mjs +0 -217
- package/dist/browser/chunk-4RD3AFSB.mjs +0 -32
- package/dist/browser/chunk-5W3MMTLG.mjs +0 -19
- package/dist/browser/chunk-5YWB3E2W.mjs +0 -92
- package/dist/browser/chunk-7IGKGWSQ.mjs +0 -79
- package/dist/browser/chunk-AI5UI46D.mjs +0 -12
- package/dist/browser/chunk-ATEBYXP6.mjs +0 -10
- package/dist/browser/chunk-BLT4RHCJ.mjs +0 -241
- package/dist/browser/chunk-C26SPCGQ.mjs +0 -2636
- package/dist/browser/chunk-C4FJ3WDY.mjs +0 -177
- package/dist/browser/chunk-CXNTHHA7.mjs +0 -63
- package/dist/browser/chunk-DSXIBE6N.mjs +0 -78
- package/dist/browser/chunk-DUH6QUVU.mjs +0 -2374
- package/dist/browser/chunk-ELV4OZOI.mjs +0 -29
- package/dist/browser/chunk-EXQZGUQH.mjs +0 -193
- package/dist/browser/chunk-G64Q6OJF.mjs +0 -96
- package/dist/browser/chunk-HOZW3PKP.mjs +0 -9
- package/dist/browser/chunk-HUCSHDTB.mjs +0 -100
- package/dist/browser/chunk-JPTQZWJQ.mjs +0 -10
- package/dist/browser/chunk-K3IPRX6D.mjs +0 -2559
- package/dist/browser/chunk-ML7THVLJ.mjs +0 -38
- package/dist/browser/chunk-MY2XKH22.mjs +0 -40
- package/dist/browser/chunk-NLWTBAGB.mjs +0 -111
- package/dist/browser/chunk-NXQG7DRA.mjs +0 -318
- package/dist/browser/chunk-OEDCEZXJ.mjs +0 -92
- package/dist/browser/chunk-OIZS5KIX.mjs +0 -6
- package/dist/browser/chunk-RA6LSBCM.mjs +0 -43
- package/dist/browser/chunk-TK63WFXK.mjs +0 -90
- package/dist/browser/chunk-TY7L6OXO.mjs +0 -69
- package/dist/browser/chunk-U3JOQGWX.mjs +0 -19
- package/dist/browser/chunk-U4YDIBUT.mjs +0 -653
- package/dist/browser/chunk-UATIJ4KU.mjs +0 -21
- package/dist/browser/chunk-UKOWD2K5.mjs +0 -315
- package/dist/browser/chunk-UTMHUHUV.mjs +0 -150
- package/dist/browser/chunk-V43N6TZO.mjs +0 -857
- package/dist/browser/chunk-VI7BQR4U.mjs +0 -21
- package/dist/browser/chunk-WN464PTL.mjs +0 -375
- package/dist/browser/chunk-WXLBZJMT.mjs +0 -25
- package/dist/browser/chunk-X7TXYUKO.mjs +0 -86
- package/dist/browser/chunk-XAWNZ4G2.mjs +0 -151
- package/dist/browser/chunk-Y6IBAUNO.mjs +0 -561
- package/dist/browser/chunk-ZI2V4VD7.mjs +0 -21
- package/dist/browser/cold-module-YNUUDNOM.mjs +0 -761
- package/dist/browser/engine-hooks-HBVS6YM4.mjs +0 -18
- package/dist/browser/gzip-5S7ROJFJ.mjs +0 -1
- package/dist/browser/import-5ESVMFDJ.mjs +0 -20
- package/dist/browser/methods-KTQCSIN4.mjs +0 -30
- package/dist/browser/module-NDSQLPMQ.mjs +0 -25
- package/dist/browser/operations-OJ3BXS55.mjs +0 -5
- package/dist/browser/phrase-module-HAT3TLZN.mjs +0 -328
- package/dist/browser/pool-3JLET5RO.mjs +0 -297
- package/dist/browser/release-HYXPVJVS.mjs +0 -32
- package/dist/browser/restore-queue-LQBBTODR.mjs +0 -55
- package/dist/browser/retention-TY3L3BFN.mjs +0 -211
- package/dist/browser/snapshot-5FHPPCNZ.mjs +0 -965
- package/dist/browser/start-2UZTOBG5.mjs +0 -26
- package/dist/browser/sync-state-P5XG6LTQ.mjs +0 -15
- package/dist/browser/write-ULXAN5B4.mjs +0 -196
- package/dist/chunk-2NE7VCYE.mjs +0 -212
- package/dist/chunk-2ROUFMQX.mjs +0 -543
- package/dist/chunk-37CD3OKS.mjs +0 -87
- package/dist/chunk-3MXV3VHR.mjs +0 -46
- package/dist/chunk-3OH67G7R.mjs +0 -214
- package/dist/chunk-4B7JIGQD.mjs +0 -106
- package/dist/chunk-5YNRKI2C.mjs +0 -81
- package/dist/chunk-6HTGOXIK.mjs +0 -875
- package/dist/chunk-6OEGXLBX.mjs +0 -57
- package/dist/chunk-6RC4K46J.mjs +0 -86
- package/dist/chunk-7GFE3PEY.mjs +0 -40
- package/dist/chunk-7GXJUJ24.mjs +0 -49
- package/dist/chunk-7V5IUP2T.mjs +0 -63
- package/dist/chunk-A4L7YTKX.mjs +0 -458
- package/dist/chunk-BEZH7VEH.mjs +0 -23
- package/dist/chunk-BNL5OPRV.mjs +0 -634
- package/dist/chunk-BTPGQC6Z.mjs +0 -27
- package/dist/chunk-C7XQYG6U.mjs +0 -50
- package/dist/chunk-CQZXZ75V.mjs +0 -562
- package/dist/chunk-CWS55TEX.mjs +0 -242
- package/dist/chunk-CZQ33DLW.mjs +0 -78
- package/dist/chunk-EEBCDP36.mjs +0 -32
- package/dist/chunk-FB6463IN.mjs +0 -1499
- package/dist/chunk-FCJ553HS.mjs +0 -655
- package/dist/chunk-FEZVDOWX.mjs +0 -6996
- package/dist/chunk-FOCV4CBZ.mjs +0 -87
- package/dist/chunk-FQBFZAWG.mjs +0 -27
- package/dist/chunk-G6HRSGOU.mjs +0 -74
- package/dist/chunk-GES7U2PM.mjs +0 -68
- package/dist/chunk-GH4WQ22V.mjs +0 -34
- package/dist/chunk-GPWMUPCA.mjs +0 -1126
- package/dist/chunk-GQPTDQCL.mjs +0 -54
- package/dist/chunk-HJSN7UYG.mjs +0 -10
- package/dist/chunk-I54T6CQP.mjs +0 -117
- package/dist/chunk-IPN7S4KX.mjs +0 -130
- package/dist/chunk-J4IJTTEX.mjs +0 -226
- package/dist/chunk-JSV6OQ4C.mjs +0 -74
- package/dist/chunk-K4ZIGL2O.mjs +0 -290
- package/dist/chunk-KAKQ74LS.mjs +0 -53
- package/dist/chunk-KCQYFO4K.mjs +0 -62
- package/dist/chunk-KHKIRS5D.mjs +0 -113
- package/dist/chunk-KOKM4PQN.mjs +0 -52
- package/dist/chunk-KP7TYHWT.mjs +0 -92
- package/dist/chunk-KZ3NX2P7.mjs +0 -21
- package/dist/chunk-L5ORED7V.mjs +0 -25
- package/dist/chunk-LDNCLRZU.mjs +0 -218
- package/dist/chunk-LHKOSI2J.mjs +0 -58
- package/dist/chunk-LQG5G2LY.mjs +0 -39
- package/dist/chunk-MATMVH65.mjs +0 -9
- package/dist/chunk-MP7ABPTD.mjs +0 -189
- package/dist/chunk-MW6BR4QP.mjs +0 -316
- package/dist/chunk-MWD5VPN7.mjs +0 -21
- package/dist/chunk-ODYKO5TO.mjs +0 -101
- package/dist/chunk-OG7UGJ6F.mjs +0 -63
- package/dist/chunk-ORN5BLL7.mjs +0 -11
- package/dist/chunk-OYABFKTW.mjs +0 -1974
- package/dist/chunk-P5LANSH6.mjs +0 -121
- package/dist/chunk-PELHVTO7.mjs +0 -24
- package/dist/chunk-PIH5SJ4N.mjs +0 -7481
- package/dist/chunk-PSZI4O24.mjs +0 -253
- package/dist/chunk-PV2CG7EJ.mjs +0 -886
- package/dist/chunk-PWGYQXML.mjs +0 -470
- package/dist/chunk-Q2UL2TPC.mjs +0 -21
- package/dist/chunk-QHPYS427.mjs +0 -66
- package/dist/chunk-QJVOLKU6.mjs +0 -111
- package/dist/chunk-QLDABJZM.mjs +0 -20
- package/dist/chunk-QYRNLLLI.mjs +0 -99
- package/dist/chunk-RCX4WNLC.mjs +0 -151
- package/dist/chunk-RFBLQLLZ.mjs +0 -16
- package/dist/chunk-RIHIVFIQ.mjs +0 -240
- package/dist/chunk-RLOES5SX.mjs +0 -31
- package/dist/chunk-RWURUDSP.mjs +0 -2639
- package/dist/chunk-RZWWB2XR.mjs +0 -96
- package/dist/chunk-S5LN746F.mjs +0 -10
- package/dist/chunk-SOI6LTHM.mjs +0 -216
- package/dist/chunk-SQJWAIF4.mjs +0 -12
- package/dist/chunk-TDIK6NTV.mjs +0 -10
- package/dist/chunk-TQXHPFWT.mjs +0 -177
- package/dist/chunk-U55XJEIG.mjs +0 -18
- package/dist/chunk-UD5HIS4U.mjs +0 -382
- package/dist/chunk-UHICS3JI.mjs +0 -83
- package/dist/chunk-UJDJB3NE.mjs +0 -913
- package/dist/chunk-VD7J552I.mjs +0 -28
- package/dist/chunk-VSLSGASN.mjs +0 -30
- package/dist/chunk-VZ2ONHEE.mjs +0 -3715
- package/dist/chunk-W7OSSKH5.mjs +0 -1427
- package/dist/chunk-WZ7YV54N.mjs +0 -152
- package/dist/chunk-X5CV2E2B.mjs +0 -1
- package/dist/chunk-Y4WPNHMC.mjs +0 -50
- package/dist/chunk-YEKL4JBK.mjs +0 -96
- package/dist/chunk-ZXNQEW43.mjs +0 -18
- package/dist/chunk-ZYAY26KG.mjs +0 -29
- package/dist/direct-executor-V5DRIECI.mjs +0 -34
- package/dist/durability-wiring-3TD62MBI.mjs +0 -4072
- package/dist/engine-hooks-HA3SBOBR.mjs +0 -54
- package/dist/gzip-F4HMIEEQ.mjs +0 -1
- package/dist/import-GPKLTSKA.mjs +0 -56
- package/dist/methods-7IOINERF.mjs +0 -30
- package/dist/module-JYHFTVPS.mjs +0 -63
- package/dist/operations-G5EP6JPX.mjs +0 -5
- package/dist/phrase-module-XW5MKWP5.mjs +0 -330
- package/dist/pool-Y4A46T36.mjs +0 -298
- package/dist/react-native/chunks/analysis-change-QUVDNABS.mjs +0 -934
- package/dist/react-native/chunks/analysis-change-entry-OC4XASBF.mjs +0 -1
- package/dist/react-native/chunks/archive-history-MJKUQLSU.mjs +0 -29
- package/dist/react-native/chunks/chunk-2PRHILX3.mjs +0 -529
- package/dist/react-native/chunks/chunk-3NQOVO3K.mjs +0 -1
- package/dist/react-native/chunks/chunk-3WI35N75.mjs +0 -226
- package/dist/react-native/chunks/chunk-4DII3ZSM.mjs +0 -73
- package/dist/react-native/chunks/chunk-4J74WHQM.mjs +0 -177
- package/dist/react-native/chunks/chunk-4NWR3NGS.mjs +0 -151
- package/dist/react-native/chunks/chunk-5CQX3XXV.mjs +0 -17
- package/dist/react-native/chunks/chunk-5MSX5FRT.mjs +0 -858
- package/dist/react-native/chunks/chunk-6OFDUYVX.mjs +0 -92
- package/dist/react-native/chunks/chunk-6VBXNFLE.mjs +0 -9
- package/dist/react-native/chunks/chunk-6ZELFCK5.mjs +0 -315
- package/dist/react-native/chunks/chunk-AAAETEJK.mjs +0 -27
- package/dist/react-native/chunks/chunk-AM7RSBPF.mjs +0 -32
- package/dist/react-native/chunks/chunk-BITYFZSZ.mjs +0 -242
- package/dist/react-native/chunks/chunk-C5G6TJ7A.mjs +0 -140
- package/dist/react-native/chunks/chunk-CHPTFFJM.mjs +0 -43
- package/dist/react-native/chunks/chunk-DIYDOIM4.mjs +0 -10
- package/dist/react-native/chunks/chunk-DMIFXZ3Q.mjs +0 -432
- package/dist/react-native/chunks/chunk-DVDX4SDR.mjs +0 -375
- package/dist/react-native/chunks/chunk-DXRSEWA2.mjs +0 -12
- package/dist/react-native/chunks/chunk-F753DA54.mjs +0 -23
- package/dist/react-native/chunks/chunk-FHPW7P2O.mjs +0 -40
- package/dist/react-native/chunks/chunk-FTZHMRD2.mjs +0 -18
- package/dist/react-native/chunks/chunk-HJBJBH26.mjs +0 -34
- package/dist/react-native/chunks/chunk-IAENKE2D.mjs +0 -21
- package/dist/react-native/chunks/chunk-IO2SMUQD.mjs +0 -10
- package/dist/react-native/chunks/chunk-IYNT75CE.mjs +0 -111
- package/dist/react-native/chunks/chunk-JDOEEMEF.mjs +0 -38
- package/dist/react-native/chunks/chunk-JWUCMVRK.mjs +0 -15
- package/dist/react-native/chunks/chunk-KSBYEMCB.mjs +0 -100
- package/dist/react-native/chunks/chunk-KU646XXT.mjs +0 -164
- package/dist/react-native/chunks/chunk-LU3Y3P63.mjs +0 -68
- package/dist/react-native/chunks/chunk-LVIKKAA6.mjs +0 -93
- package/dist/react-native/chunks/chunk-LZSLNSUN.mjs +0 -193
- package/dist/react-native/chunks/chunk-MJDQU5MW.mjs +0 -1225
- package/dist/react-native/chunks/chunk-NNE4VDMM.mjs +0 -8
- package/dist/react-native/chunks/chunk-NVVRSRX5.mjs +0 -78
- package/dist/react-native/chunks/chunk-OCSLSH27.mjs +0 -22723
- package/dist/react-native/chunks/chunk-PB2YXVQW.mjs +0 -29
- package/dist/react-native/chunks/chunk-PJHAB5ZY.mjs +0 -79
- package/dist/react-native/chunks/chunk-PSWKQVVT.mjs +0 -9
- package/dist/react-native/chunks/chunk-RDWG33MM.mjs +0 -79
- package/dist/react-native/chunks/chunk-SK2PWYDH.mjs +0 -654
- package/dist/react-native/chunks/chunk-SUPXRTMD.mjs +0 -96
- package/dist/react-native/chunks/chunk-TORU2OHQ.mjs +0 -218
- package/dist/react-native/chunks/chunk-U4KSKA4Z.mjs +0 -23
- package/dist/react-native/chunks/chunk-UNUFZ2QY.mjs +0 -68
- package/dist/react-native/chunks/chunk-WBYQRHDY.mjs +0 -86
- package/dist/react-native/chunks/chunk-WVWJNUMN.mjs +0 -2562
- package/dist/react-native/chunks/chunk-YH7QY657.mjs +0 -288
- package/dist/react-native/chunks/chunk-YZW4CHM6.mjs +0 -562
- package/dist/react-native/chunks/chunk-ZNZ6CPAZ.mjs +0 -562
- package/dist/react-native/chunks/chunk-ZVQMBF2H.mjs +0 -63
- package/dist/react-native/chunks/chunk-ZWAIN4GG.mjs +0 -2636
- package/dist/react-native/chunks/chunk-ZZT7CEN7.mjs +0 -92
- package/dist/react-native/chunks/cold-module-N6KFNNZA.mjs +0 -773
- package/dist/react-native/chunks/durability-wiring-RN64S2TL.mjs +0 -4984
- package/dist/react-native/chunks/engine-hooks-CWA5CKCA.mjs +0 -30
- package/dist/react-native/chunks/gzip.react-native-HLEPDKZ3.mjs +0 -3
- package/dist/react-native/chunks/import-5UAWBRJP.mjs +0 -32
- package/dist/react-native/chunks/methods-6W5U4C3H.mjs +0 -30
- package/dist/react-native/chunks/module-6RP4ZCBW.mjs +0 -37
- package/dist/react-native/chunks/operations-GNRMD6EX.mjs +0 -5
- package/dist/react-native/chunks/phrase-module-QK22HSQ2.mjs +0 -329
- package/dist/react-native/chunks/pool-JR3NJCAF.mjs +0 -297
- package/dist/react-native/chunks/release-2SIHZWDO.mjs +0 -32
- package/dist/react-native/chunks/restore-hooks-ENFMDTWC.mjs +0 -127
- package/dist/react-native/chunks/restore-queue-4R6AASE5.mjs +0 -55
- package/dist/react-native/chunks/retention-5GTFT3GR.mjs +0 -223
- package/dist/react-native/chunks/snapshot-5LGPQXFS.mjs +0 -976
- package/dist/react-native/chunks/start-ZQJVZ5DN.mjs +0 -38
- package/dist/react-native/chunks/sync-state-PASCIHHT.mjs +0 -15
- package/dist/react-native/chunks/write-6BRYIIZ7.mjs +0 -208
- package/dist/release-SMR4WJD4.mjs +0 -32
- package/dist/restore-hooks-HXLIEB4A.mjs +0 -153
- package/dist/restore-queue-LZH7LMLR.mjs +0 -55
- package/dist/retention-3K7ARGAG.mjs +0 -66
- package/dist/runtime-COIUORCN.mjs +0 -177
- package/dist/snapshot-O7ICP7NJ.mjs +0 -783
- package/dist/start-S4PFP6RS.mjs +0 -66
- package/dist/sync-state-ZWHLAFLE.mjs +0 -15
- package/dist/thread-YLJ3ZPQ3.mjs +0 -50
- package/dist/write-2OBJGLFS.mjs +0 -233
- /package/dist/browser/{chunk-M3MQE2X7.mjs → digest-leaf-64IPRPZD.mjs} +0 -0
- /package/dist/browser/{chunk-JNOAKDUM.mjs → gzip-JF3S6PPT.mjs} +0 -0
- /package/dist/{chunk-ZXNNR73R.mjs → gzip-2UCZW2MM.mjs} +0 -0
package/dist/chunk-PV2CG7EJ.mjs
DELETED
|
@@ -1,886 +0,0 @@
|
|
|
1
|
-
import { PARTIAL_WORD_MIN_CODE_POINTS, PARTIAL_WORDS_ADDED_PER_QUERY, DEFAULT_FUZZY_PREFIX_LENGTH } from './chunk-FQBFZAWG.mjs';
|
|
2
|
-
import { tokenizeOptions, getNestedValue } from './chunk-W5EB5XKI.mjs';
|
|
3
|
-
import { fuzzyTermMatches } from './chunk-GES7U2PM.mjs';
|
|
4
|
-
import { encodeStringBlob } from './chunk-G6HRSGOU.mjs';
|
|
5
|
-
import { tokenize, resolveStopWords, transformToken, visitTokens, visitSurfaceSpellings } from './chunk-A4L7YTKX.mjs';
|
|
6
|
-
import { compareCodePoints, codePointCount } from './chunk-TBC3XUL2.mjs';
|
|
7
|
-
|
|
8
|
-
// src/core/partition/suggestions.ts
|
|
9
|
-
function verbatimOccurrences(state, token) {
|
|
10
|
-
const postingList = state.invertedIdx.lookup(token);
|
|
11
|
-
if (!postingList) return 0;
|
|
12
|
-
const derived = postingList.totalTermFrequency - state.surfaceRegistry.stemChangedTotalFor(token);
|
|
13
|
-
return derived > 0 ? derived : 0;
|
|
14
|
-
}
|
|
15
|
-
function suggestDisplayTerms(state, surfacePrefix, stemmedPrefix, limit) {
|
|
16
|
-
if (limit <= 0 || surfacePrefix.length === 0) return [];
|
|
17
|
-
const groups = /* @__PURE__ */ new Map();
|
|
18
|
-
for (const candidate of state.surfaceRegistry.candidatesForPrefix(surfacePrefix)) {
|
|
19
|
-
const postingList = state.invertedIdx.lookup(candidate.token);
|
|
20
|
-
if (!postingList || postingList.docIdSet.size === 0) continue;
|
|
21
|
-
let group = groups.get(candidate.token);
|
|
22
|
-
if (!group) {
|
|
23
|
-
group = { documentFrequency: postingList.docIdSet.size, surfaces: [] };
|
|
24
|
-
groups.set(candidate.token, group);
|
|
25
|
-
}
|
|
26
|
-
group.surfaces.push({ surface: candidate.surface, occurrences: candidate.occurrences });
|
|
27
|
-
}
|
|
28
|
-
const termPrefixes = state.surfaceRegistry.size() === 0 && stemmedPrefix !== surfacePrefix && stemmedPrefix.length > 0 ? [surfacePrefix, stemmedPrefix] : [surfacePrefix];
|
|
29
|
-
for (const prefix of termPrefixes) {
|
|
30
|
-
for (const suggestion of state.invertedIdx.prefixSearch(prefix, Number.MAX_SAFE_INTEGER)) {
|
|
31
|
-
const occurrences = verbatimOccurrences(state, suggestion.term);
|
|
32
|
-
if (occurrences === 0) continue;
|
|
33
|
-
let group = groups.get(suggestion.term);
|
|
34
|
-
if (!group) {
|
|
35
|
-
group = { documentFrequency: suggestion.documentFrequency, surfaces: [] };
|
|
36
|
-
groups.set(suggestion.term, group);
|
|
37
|
-
} else if (group.surfaces.some((s) => s.surface === suggestion.term)) {
|
|
38
|
-
continue;
|
|
39
|
-
}
|
|
40
|
-
group.surfaces.push({ surface: suggestion.term, occurrences });
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
const results = [];
|
|
44
|
-
for (const [token, group] of groups) {
|
|
45
|
-
results.push({ token, documentFrequency: group.documentFrequency, surfaces: group.surfaces });
|
|
46
|
-
}
|
|
47
|
-
results.sort((a, b) => b.documentFrequency - a.documentFrequency || compareCodePoints(a.token, b.token));
|
|
48
|
-
if (results.length > limit) results.length = limit;
|
|
49
|
-
return results;
|
|
50
|
-
}
|
|
51
|
-
function partitionDocumentFrequency(subs, token) {
|
|
52
|
-
let documents = 0;
|
|
53
|
-
for (const sub of subs) documents += sub.invertedIdx.documentFrequency(token);
|
|
54
|
-
return documents;
|
|
55
|
-
}
|
|
56
|
-
function expandTermPrefix(subs, surfacePrefix, stemmedToken, maxExpansions) {
|
|
57
|
-
if (maxExpansions <= 0 || surfacePrefix.length === 0) return [];
|
|
58
|
-
const candidates = /* @__PURE__ */ new Set();
|
|
59
|
-
const holdsSurfaceForms = subs.some((sub) => sub.surfaceRegistry.size() > 0);
|
|
60
|
-
const termPrefixes = !holdsSurfaceForms && stemmedToken !== surfacePrefix && stemmedToken.length > 0 ? [surfacePrefix, stemmedToken] : [surfacePrefix];
|
|
61
|
-
for (const sub of subs) {
|
|
62
|
-
for (const candidate of sub.surfaceRegistry.candidatesForPrefix(surfacePrefix)) candidates.add(candidate.token);
|
|
63
|
-
for (const prefix of termPrefixes) {
|
|
64
|
-
for (const suggestion of sub.invertedIdx.prefixSearch(prefix, Number.MAX_SAFE_INTEGER)) {
|
|
65
|
-
if (candidates.has(suggestion.term)) continue;
|
|
66
|
-
if (verbatimOccurrences(sub, suggestion.term) > 0) candidates.add(suggestion.term);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
const ranked = [];
|
|
71
|
-
for (const token of candidates) {
|
|
72
|
-
const documents = partitionDocumentFrequency(subs, token);
|
|
73
|
-
if (documents > 0) ranked.push({ token, documents });
|
|
74
|
-
}
|
|
75
|
-
ranked.sort((a, b) => b.documents - a.documents || compareCodePoints(a.token, b.token));
|
|
76
|
-
if (ranked.length > maxExpansions) ranked.length = maxExpansions;
|
|
77
|
-
return ranked.map((entry) => entry.token);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// src/core/partition/partial-words/text.ts
|
|
81
|
-
var encoder = new TextEncoder();
|
|
82
|
-
var LAST_BASIC_PLANE_CODE_POINT = 65535;
|
|
83
|
-
var BASIC_PLANE_SIZE = 65536;
|
|
84
|
-
var UTF8_CONTINUATION_MASK = 192;
|
|
85
|
-
var UTF8_CONTINUATION_BITS = 128;
|
|
86
|
-
function codePointsOf(text) {
|
|
87
|
-
const points = [];
|
|
88
|
-
let index = 0;
|
|
89
|
-
while (index < text.length) {
|
|
90
|
-
const point = text.codePointAt(index) ?? text.charCodeAt(index);
|
|
91
|
-
points.push(point);
|
|
92
|
-
index += point > LAST_BASIC_PLANE_CODE_POINT ? 2 : 1;
|
|
93
|
-
}
|
|
94
|
-
return points;
|
|
95
|
-
}
|
|
96
|
-
function runKeyAt(points, at) {
|
|
97
|
-
return String.fromCodePoint(points[at], points[at + 1], points[at + 2]);
|
|
98
|
-
}
|
|
99
|
-
function packedRunKeyAt(points, at) {
|
|
100
|
-
const first = points[at];
|
|
101
|
-
const second = points[at + 1];
|
|
102
|
-
const third = points[at + 2];
|
|
103
|
-
if ((first | second | third) > LAST_BASIC_PLANE_CODE_POINT) return String.fromCodePoint(first, second, third);
|
|
104
|
-
return first * BASIC_PLANE_SIZE * BASIC_PLANE_SIZE + second * BASIC_PLANE_SIZE + third;
|
|
105
|
-
}
|
|
106
|
-
function partialWordProbe(text) {
|
|
107
|
-
return { text, codePoints: codePointsOf(text), utf8: encoder.encode(text) };
|
|
108
|
-
}
|
|
109
|
-
function utf8Contains(haystack, start, end, needle) {
|
|
110
|
-
const last = end - needle.length;
|
|
111
|
-
for (let from = start; from <= last; from++) {
|
|
112
|
-
let at = 0;
|
|
113
|
-
while (at < needle.length && haystack[from + at] === needle[at]) at++;
|
|
114
|
-
if (at === needle.length) return true;
|
|
115
|
-
}
|
|
116
|
-
return false;
|
|
117
|
-
}
|
|
118
|
-
function utf8CodePointCount(bytes, start, end) {
|
|
119
|
-
let count = 0;
|
|
120
|
-
for (let at = start; at < end; at++) {
|
|
121
|
-
if ((bytes[at] & UTF8_CONTINUATION_MASK) !== UTF8_CONTINUATION_BITS) count++;
|
|
122
|
-
}
|
|
123
|
-
return count;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// src/core/partition/partial-words/expansion.ts
|
|
127
|
-
function excludedFromRequest(request, token) {
|
|
128
|
-
if (token === request.ownToken) return true;
|
|
129
|
-
return request.tolerance > 0 && fuzzyTermMatches(request.ownToken, token, request.tolerance, request.prefixLength);
|
|
130
|
-
}
|
|
131
|
-
function addedWordsFor(subs, readers, request) {
|
|
132
|
-
if (request.share <= 0) return [];
|
|
133
|
-
const probe = partialWordProbe(request.written);
|
|
134
|
-
const shortestSpelling = /* @__PURE__ */ new Map();
|
|
135
|
-
for (const reader of readers) {
|
|
136
|
-
reader.forEachContaining(probe, (token, spellingLength) => {
|
|
137
|
-
const known = shortestSpelling.get(token);
|
|
138
|
-
if (known === void 0 || spellingLength < known) shortestSpelling.set(token, spellingLength);
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
const ranked = [];
|
|
142
|
-
for (const [token, spellingLength] of shortestSpelling) {
|
|
143
|
-
if (excludedFromRequest(request, token)) continue;
|
|
144
|
-
const documents = partitionDocumentFrequency(subs, token);
|
|
145
|
-
if (documents > 0) ranked.push({ token, documents, spellingLength });
|
|
146
|
-
}
|
|
147
|
-
ranked.sort((a, b) => b.documents - a.documents || compareCodePoints(a.token, b.token));
|
|
148
|
-
if (ranked.length > request.share) ranked.length = request.share;
|
|
149
|
-
const writtenLength = probe.codePoints.length;
|
|
150
|
-
return ranked.map((word) => ({ token: word.token, factor: writtenLength / word.spellingLength }));
|
|
151
|
-
}
|
|
152
|
-
function expandPartialWords(subs, analysis, requests) {
|
|
153
|
-
const readers = [];
|
|
154
|
-
for (const sub of subs) {
|
|
155
|
-
const reader = sub.partialWords.readerFor(analysis);
|
|
156
|
-
if (reader !== null) readers.push(reader);
|
|
157
|
-
}
|
|
158
|
-
return requests.map((request) => readers.length === 0 ? [] : addedWordsFor(subs, readers, request));
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// src/core/partition/partial-words/constants.ts
|
|
162
|
-
var PARTIAL_WORD_RUN_CODE_POINTS = 3;
|
|
163
|
-
var GROWING_PARTIAL_ENTRY_BYTES = 104;
|
|
164
|
-
var GROWING_PARTIAL_PENDING_ENTRY_BYTES = 8;
|
|
165
|
-
var GROWING_PARTIAL_PENDING_ENTRIES_PER_ENTRY = 2;
|
|
166
|
-
var GROWING_PARTIAL_RUN_BYTES = 120;
|
|
167
|
-
var GROWING_PARTIAL_RUN_MEMBER_BYTES = 24;
|
|
168
|
-
var FROZEN_PARTIAL_REMOVED_ENTRY_BYTES = 48;
|
|
169
|
-
|
|
170
|
-
// src/core/partition/partial-words/spellings.ts
|
|
171
|
-
var LAST_BASIC_PLANE_CODE_POINT2 = 65535;
|
|
172
|
-
function codePointCountOf(text) {
|
|
173
|
-
let count = 0;
|
|
174
|
-
for (let index = 0; index < text.length; count++) {
|
|
175
|
-
index += (text.codePointAt(index) ?? 0) > LAST_BASIC_PLANE_CODE_POINT2 ? 2 : 1;
|
|
176
|
-
}
|
|
177
|
-
return count;
|
|
178
|
-
}
|
|
179
|
-
function holdsRun(spelling) {
|
|
180
|
-
if (spelling.length > 2 * PARTIAL_WORD_RUN_CODE_POINTS) return true;
|
|
181
|
-
if (spelling.length <= PARTIAL_WORD_RUN_CODE_POINTS) return false;
|
|
182
|
-
return codePointCountOf(spelling) > PARTIAL_WORD_RUN_CODE_POINTS;
|
|
183
|
-
}
|
|
184
|
-
function countSpelling(counts, token, spelling, change) {
|
|
185
|
-
if (!holdsRun(spelling)) return;
|
|
186
|
-
let byToken = counts.get(token);
|
|
187
|
-
if (byToken === void 0) {
|
|
188
|
-
if (change <= 0) return;
|
|
189
|
-
byToken = /* @__PURE__ */ new Map();
|
|
190
|
-
counts.set(token, byToken);
|
|
191
|
-
}
|
|
192
|
-
const next = (byToken.get(spelling) ?? 0) + change;
|
|
193
|
-
if (next > 0) {
|
|
194
|
-
byToken.set(spelling, next);
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
byToken.delete(spelling);
|
|
198
|
-
if (byToken.size === 0) counts.delete(token);
|
|
199
|
-
}
|
|
200
|
-
function textsOf(value) {
|
|
201
|
-
if (typeof value === "string") return [value];
|
|
202
|
-
if (!Array.isArray(value)) return [];
|
|
203
|
-
return value.filter((element) => typeof element === "string");
|
|
204
|
-
}
|
|
205
|
-
function visitFieldTexts(document, fields, visit) {
|
|
206
|
-
for (const field of fields) {
|
|
207
|
-
for (const text of textsOf(getNestedValue(document, field))) visit(text);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
function visitDocumentSpellings(document, analysis, visit) {
|
|
211
|
-
const tokenizing = { ...tokenizeOptions(analysis.options), collectSurfaces: true };
|
|
212
|
-
const visitOccurrence = (token, _position, surface) => {
|
|
213
|
-
visit(token, surface ?? token);
|
|
214
|
-
};
|
|
215
|
-
visitFieldTexts(document, analysis.fields, (text) => visitTokens(text, analysis.language, tokenizing, visitOccurrence));
|
|
216
|
-
}
|
|
217
|
-
function visitDocumentSurfaceSpellings(document, analysis, visit) {
|
|
218
|
-
if (analysis.options?.customTokenizer !== void 0) return;
|
|
219
|
-
visitFieldTexts(document, analysis.fields, (text) => visitSurfaceSpellings(text, analysis.language, visit));
|
|
220
|
-
}
|
|
221
|
-
function countDocumentSpellings(counts, document, analysis, direction) {
|
|
222
|
-
visitDocumentSpellings(document, analysis, (token, spelling) => countSpelling(counts, token, spelling, direction));
|
|
223
|
-
}
|
|
224
|
-
function spellingCountsOf(documents, analysis) {
|
|
225
|
-
const counts = /* @__PURE__ */ new Map();
|
|
226
|
-
for (const document of documents) countDocumentSpellings(counts, document, analysis, 1);
|
|
227
|
-
return counts;
|
|
228
|
-
}
|
|
229
|
-
function encodePartialSpellings(fields, counts) {
|
|
230
|
-
const encoded = { fields: [...fields], tokens: [], spellings: [], counts: [] };
|
|
231
|
-
for (const [token, byToken] of counts) {
|
|
232
|
-
for (const [spelling, count] of byToken) {
|
|
233
|
-
encoded.tokens.push(token);
|
|
234
|
-
encoded.spellings.push(spelling);
|
|
235
|
-
encoded.counts.push(count);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
return encoded;
|
|
239
|
-
}
|
|
240
|
-
function sameFields(left, right) {
|
|
241
|
-
if (left.length !== right.length) return false;
|
|
242
|
-
for (let at = 0; at < left.length; at++) {
|
|
243
|
-
if (left[at] !== right[at]) return false;
|
|
244
|
-
}
|
|
245
|
-
return true;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
// src/core/partition/partial-words/frozen-table.ts
|
|
249
|
-
var decoder = new TextDecoder();
|
|
250
|
-
function compareEntries(left, right) {
|
|
251
|
-
return compareCodePoints(left.spelling, right.spelling) || left.tokenIndex - right.tokenIndex;
|
|
252
|
-
}
|
|
253
|
-
function orderedEntriesOf(source, tokenTable) {
|
|
254
|
-
const entries = [];
|
|
255
|
-
for (let at = 0; at < source.tokens.length; at++) {
|
|
256
|
-
if (source.counts[at] <= 0) continue;
|
|
257
|
-
const tokenIndex = tokenTable.find(source.tokens[at]);
|
|
258
|
-
if (tokenIndex >= 0) entries.push({ spelling: source.spellings[at], tokenIndex, count: source.counts[at] });
|
|
259
|
-
}
|
|
260
|
-
entries.sort(compareEntries);
|
|
261
|
-
const distinct = [];
|
|
262
|
-
for (const entry of entries) {
|
|
263
|
-
const last = distinct[distinct.length - 1];
|
|
264
|
-
if (last !== void 0 && compareEntries(last, entry) === 0) last.count += entry.count;
|
|
265
|
-
else distinct.push(entry);
|
|
266
|
-
}
|
|
267
|
-
return distinct;
|
|
268
|
-
}
|
|
269
|
-
function buildPartialWordTable(source, tokenTable) {
|
|
270
|
-
const spellings = [];
|
|
271
|
-
const spellingTokens = [];
|
|
272
|
-
const spellingCounts = [];
|
|
273
|
-
const runLists = /* @__PURE__ */ new Map();
|
|
274
|
-
const addSpelling = (spelling, tokenIndex, count) => {
|
|
275
|
-
const points = codePointsOf(spelling);
|
|
276
|
-
if (points.length <= PARTIAL_WORD_RUN_CODE_POINTS) return;
|
|
277
|
-
const entry = spellings.length;
|
|
278
|
-
spellings.push(spelling);
|
|
279
|
-
spellingTokens.push(tokenIndex);
|
|
280
|
-
spellingCounts.push(count);
|
|
281
|
-
for (let at = 0; at + PARTIAL_WORD_RUN_CODE_POINTS <= points.length; at++) {
|
|
282
|
-
const key = runKeyAt(points, at);
|
|
283
|
-
const list = runLists.get(key);
|
|
284
|
-
if (list === void 0) runLists.set(key, [entry]);
|
|
285
|
-
else if (list[list.length - 1] !== entry) list.push(entry);
|
|
286
|
-
}
|
|
287
|
-
};
|
|
288
|
-
for (const entry of orderedEntriesOf(source, tokenTable)) addSpelling(entry.spelling, entry.tokenIndex, entry.count);
|
|
289
|
-
const runKeys = [...runLists.keys()].sort(compareCodePoints);
|
|
290
|
-
const runs = new Uint32Array(runKeys.length * PARTIAL_WORD_RUN_CODE_POINTS);
|
|
291
|
-
const runOffsets = new Uint32Array(runKeys.length + 1);
|
|
292
|
-
let memberCount = 0;
|
|
293
|
-
for (const key of runKeys) memberCount += runLists.get(key)?.length ?? 0;
|
|
294
|
-
const runEntries = new Uint32Array(memberCount);
|
|
295
|
-
let cursor = 0;
|
|
296
|
-
for (let run = 0; run < runKeys.length; run++) {
|
|
297
|
-
const points = codePointsOf(runKeys[run]);
|
|
298
|
-
runs.set(points, run * PARTIAL_WORD_RUN_CODE_POINTS);
|
|
299
|
-
for (const entry of runLists.get(runKeys[run]) ?? []) runEntries[cursor++] = entry;
|
|
300
|
-
runOffsets[run + 1] = cursor;
|
|
301
|
-
}
|
|
302
|
-
const spellingBlob = encodeStringBlob(spellings);
|
|
303
|
-
return {
|
|
304
|
-
fields: [...source.fields],
|
|
305
|
-
spellings: spellingBlob.blob,
|
|
306
|
-
spellingOffsets: spellingBlob.offsets,
|
|
307
|
-
spellingTokens: Uint32Array.from(spellingTokens),
|
|
308
|
-
spellingCounts: Uint32Array.from(spellingCounts),
|
|
309
|
-
runs,
|
|
310
|
-
runOffsets,
|
|
311
|
-
runEntries
|
|
312
|
-
};
|
|
313
|
-
}
|
|
314
|
-
function countTableSpellings(counts, table, tokenTable) {
|
|
315
|
-
const { spellings, spellingOffsets, spellingTokens, spellingCounts } = table;
|
|
316
|
-
for (let entry = 0; entry < spellingTokens.length; entry++) {
|
|
317
|
-
const spelling = decoder.decode(spellings.subarray(spellingOffsets[entry], spellingOffsets[entry + 1]));
|
|
318
|
-
countSpelling(counts, tokenTable.tokenAt(spellingTokens[entry]), spelling, spellingCounts[entry]);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
function findRun(runs, first, second, third) {
|
|
322
|
-
let low = 0;
|
|
323
|
-
let high = runs.length / PARTIAL_WORD_RUN_CODE_POINTS;
|
|
324
|
-
while (low < high) {
|
|
325
|
-
const middle = low + high >>> 1;
|
|
326
|
-
const at = middle * PARTIAL_WORD_RUN_CODE_POINTS;
|
|
327
|
-
const difference = runs[at] - first || runs[at + 1] - second || runs[at + 2] - third;
|
|
328
|
-
if (difference === 0) return middle;
|
|
329
|
-
if (difference < 0) low = middle + 1;
|
|
330
|
-
else high = middle;
|
|
331
|
-
}
|
|
332
|
-
return -1;
|
|
333
|
-
}
|
|
334
|
-
function partialWordTableBytes(table) {
|
|
335
|
-
return table.spellings.byteLength + table.spellingOffsets.byteLength + table.spellingTokens.byteLength + table.spellingCounts.byteLength + table.runs.byteLength + table.runOffsets.byteLength + table.runEntries.byteLength;
|
|
336
|
-
}
|
|
337
|
-
function readPartialWordTable(table, tokenTable, removedCounts) {
|
|
338
|
-
const { spellings, spellingOffsets, spellingTokens, spellingCounts, runs, runOffsets, runEntries } = table;
|
|
339
|
-
function narrowestRun(points) {
|
|
340
|
-
let narrowest = -1;
|
|
341
|
-
let narrowestLength = Number.POSITIVE_INFINITY;
|
|
342
|
-
for (let at = 0; at + PARTIAL_WORD_RUN_CODE_POINTS <= points.length; at++) {
|
|
343
|
-
const run = findRun(runs, points[at], points[at + 1], points[at + 2]);
|
|
344
|
-
if (run < 0) return -1;
|
|
345
|
-
const length = runOffsets[run + 1] - runOffsets[run];
|
|
346
|
-
if (length < narrowestLength) {
|
|
347
|
-
narrowest = run;
|
|
348
|
-
narrowestLength = length;
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
return narrowest;
|
|
352
|
-
}
|
|
353
|
-
return {
|
|
354
|
-
forEachContaining(probe, visit) {
|
|
355
|
-
if (probe.codePoints.length < PARTIAL_WORD_RUN_CODE_POINTS) return;
|
|
356
|
-
const run = narrowestRun(probe.codePoints);
|
|
357
|
-
if (run < 0) return;
|
|
358
|
-
for (let member = runOffsets[run]; member < runOffsets[run + 1]; member++) {
|
|
359
|
-
const entry = runEntries[member];
|
|
360
|
-
const start = spellingOffsets[entry];
|
|
361
|
-
const end = spellingOffsets[entry + 1];
|
|
362
|
-
if (end - start <= probe.utf8.length) continue;
|
|
363
|
-
if ((removedCounts.get(entry) ?? 0) >= spellingCounts[entry]) continue;
|
|
364
|
-
if (!utf8Contains(spellings, start, end, probe.utf8)) continue;
|
|
365
|
-
const length = utf8CodePointCount(spellings, start, end);
|
|
366
|
-
if (length <= probe.codePoints.length) continue;
|
|
367
|
-
visit(tokenTable.tokenAt(spellingTokens[entry]), length);
|
|
368
|
-
}
|
|
369
|
-
},
|
|
370
|
-
entryOf(spelling) {
|
|
371
|
-
const probe = partialWordProbe(spelling);
|
|
372
|
-
if (probe.codePoints.length <= PARTIAL_WORD_RUN_CODE_POINTS) return -1;
|
|
373
|
-
const run = narrowestRun(probe.codePoints);
|
|
374
|
-
if (run < 0) return -1;
|
|
375
|
-
let exhausted = -1;
|
|
376
|
-
for (let member = runOffsets[run]; member < runOffsets[run + 1]; member++) {
|
|
377
|
-
const entry = runEntries[member];
|
|
378
|
-
const start = spellingOffsets[entry];
|
|
379
|
-
const end = spellingOffsets[entry + 1];
|
|
380
|
-
if (end - start !== probe.utf8.length || !utf8Contains(spellings, start, end, probe.utf8)) continue;
|
|
381
|
-
if ((removedCounts.get(entry) ?? 0) < spellingCounts[entry]) return entry;
|
|
382
|
-
if (exhausted < 0) exhausted = entry;
|
|
383
|
-
}
|
|
384
|
-
return exhausted;
|
|
385
|
-
},
|
|
386
|
-
bytes() {
|
|
387
|
-
return partialWordTableBytes(table);
|
|
388
|
-
}
|
|
389
|
-
};
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
// src/core/partition/partial-words/frozen-slot.ts
|
|
393
|
-
function tombstonedOrdinalsOf(documents) {
|
|
394
|
-
let marks = null;
|
|
395
|
-
for (let ordinal = 0; ordinal < documents.count; ordinal++) {
|
|
396
|
-
if (!documents.isTombstoned(ordinal)) continue;
|
|
397
|
-
marks ??= new Uint8Array(documents.count);
|
|
398
|
-
marks[ordinal] = 1;
|
|
399
|
-
}
|
|
400
|
-
return marks;
|
|
401
|
-
}
|
|
402
|
-
function addCounts(target, source) {
|
|
403
|
-
for (const [token, bySpelling] of source) {
|
|
404
|
-
for (const [spelling, count] of bySpelling) countSpelling(target, token, spelling, count);
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
function countRemovedSpellings(removed, document, analysis) {
|
|
408
|
-
const count = (spelling) => {
|
|
409
|
-
removed.set(spelling, (removed.get(spelling) ?? 0) + 1);
|
|
410
|
-
};
|
|
411
|
-
if (analysis.options?.customTokenizer !== void 0) {
|
|
412
|
-
visitDocumentSpellings(document, analysis, (_token, spelling) => count(spelling));
|
|
413
|
-
return;
|
|
414
|
-
}
|
|
415
|
-
visitDocumentSurfaceSpellings(document, analysis, count);
|
|
416
|
-
}
|
|
417
|
-
function unstemmedSpellingsOf(analysis) {
|
|
418
|
-
const { language } = analysis;
|
|
419
|
-
if (language.normalizer === void 0 || language.tokenizer?.normalizeDiacritics === true) return () => null;
|
|
420
|
-
const stopWords = resolveStopWords(language, analysis.options?.stopWordOverride);
|
|
421
|
-
return (spelling) => {
|
|
422
|
-
if (stopWords.has(spelling)) return null;
|
|
423
|
-
const normalized = transformToken(spelling, language, false, false);
|
|
424
|
-
return normalized === spelling ? null : normalized;
|
|
425
|
-
};
|
|
426
|
-
}
|
|
427
|
-
function subtractRemovedSpellings(counts, removed, analysis) {
|
|
428
|
-
const tokenOf = /* @__PURE__ */ new Map();
|
|
429
|
-
for (const [token, bySpelling] of counts) {
|
|
430
|
-
for (const spelling of bySpelling.keys()) tokenOf.set(spelling, token);
|
|
431
|
-
}
|
|
432
|
-
const unstemmedSpelling = unstemmedSpellingsOf(analysis);
|
|
433
|
-
for (const [spelling, count] of removed) {
|
|
434
|
-
const stored = tokenOf.has(spelling) ? spelling : unstemmedSpelling(spelling) ?? spelling;
|
|
435
|
-
const token = tokenOf.get(stored);
|
|
436
|
-
if (token !== void 0) countSpelling(counts, token, stored, -count);
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
function createFrozenPartialWordSlot(initial, tokenTable, documents) {
|
|
440
|
-
let table = initial;
|
|
441
|
-
let uncounted = null;
|
|
442
|
-
let removedCounts = /* @__PURE__ */ new Map();
|
|
443
|
-
let reader = initial === null ? null : readPartialWordTable(initial, tokenTable, removedCounts);
|
|
444
|
-
let pendingRemovals = [];
|
|
445
|
-
function isCounted(ordinal) {
|
|
446
|
-
return uncounted === null || uncounted[ordinal] === 0;
|
|
447
|
-
}
|
|
448
|
-
function subtractPendingRemovals(current, analysis) {
|
|
449
|
-
if (pendingRemovals.length === 0) return;
|
|
450
|
-
const removed = /* @__PURE__ */ new Map();
|
|
451
|
-
for (const ordinal of pendingRemovals) countRemovedSpellings(removed, documents.documentAt(ordinal), analysis);
|
|
452
|
-
pendingRemovals = [];
|
|
453
|
-
const unstemmedSpelling = unstemmedSpellingsOf(analysis);
|
|
454
|
-
for (const [spelling, count] of removed) {
|
|
455
|
-
let entry = current.entryOf(spelling);
|
|
456
|
-
if (entry < 0) {
|
|
457
|
-
const fallback = unstemmedSpelling(spelling);
|
|
458
|
-
if (fallback !== null) entry = current.entryOf(fallback);
|
|
459
|
-
}
|
|
460
|
-
if (entry >= 0) removedCounts.set(entry, (removedCounts.get(entry) ?? 0) + count);
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
function rebuild(analysis) {
|
|
464
|
-
uncounted = tombstonedOrdinalsOf(documents);
|
|
465
|
-
const counts = /* @__PURE__ */ new Map();
|
|
466
|
-
for (let ordinal = 0; ordinal < documents.count; ordinal++) {
|
|
467
|
-
if (isCounted(ordinal)) countDocumentSpellings(counts, documents.documentAt(ordinal), analysis, 1);
|
|
468
|
-
}
|
|
469
|
-
const rebuilt = buildPartialWordTable(encodePartialSpellings(analysis.fields, counts), tokenTable);
|
|
470
|
-
table = rebuilt;
|
|
471
|
-
removedCounts = /* @__PURE__ */ new Map();
|
|
472
|
-
pendingRemovals = [];
|
|
473
|
-
const rebuiltReader = readPartialWordTable(rebuilt, tokenTable, removedCounts);
|
|
474
|
-
reader = rebuiltReader;
|
|
475
|
-
return rebuiltReader;
|
|
476
|
-
}
|
|
477
|
-
function correctionsAgainstTable(mergedOrdinals) {
|
|
478
|
-
let corrections = 0;
|
|
479
|
-
for (let ordinal = 0; ordinal < mergedOrdinals.length; ordinal++) {
|
|
480
|
-
if (mergedOrdinals[ordinal] >= 0 !== isCounted(ordinal)) corrections += 1;
|
|
481
|
-
}
|
|
482
|
-
return corrections;
|
|
483
|
-
}
|
|
484
|
-
function keptCount(mergedOrdinals) {
|
|
485
|
-
let kept = 0;
|
|
486
|
-
for (let ordinal = 0; ordinal < mergedOrdinals.length; ordinal++) {
|
|
487
|
-
if (mergedOrdinals[ordinal] >= 0) kept += 1;
|
|
488
|
-
}
|
|
489
|
-
return kept;
|
|
490
|
-
}
|
|
491
|
-
return {
|
|
492
|
-
readerFor(analysis) {
|
|
493
|
-
if (analysis.fields.length === 0) return null;
|
|
494
|
-
if (table === null || reader === null || !sameFields(table.fields, analysis.fields)) return rebuild(analysis);
|
|
495
|
-
subtractPendingRemovals(reader, analysis);
|
|
496
|
-
return reader;
|
|
497
|
-
},
|
|
498
|
-
afterRemoval(ordinal) {
|
|
499
|
-
if (table !== null) pendingRemovals.push(ordinal);
|
|
500
|
-
},
|
|
501
|
-
tableOfEveryDocument(analysis) {
|
|
502
|
-
if (table === null || uncounted !== null || !sameFields(table.fields, analysis.fields)) return null;
|
|
503
|
-
return table;
|
|
504
|
-
},
|
|
505
|
-
countKeptSpellings(counts, analysis, mergedOrdinals) {
|
|
506
|
-
if (table === null || !sameFields(table.fields, analysis.fields) || correctionsAgainstTable(mergedOrdinals) > keptCount(mergedOrdinals)) {
|
|
507
|
-
for (let ordinal = 0; ordinal < mergedOrdinals.length; ordinal++) {
|
|
508
|
-
if (mergedOrdinals[ordinal] >= 0) countDocumentSpellings(counts, documents.documentAt(ordinal), analysis, 1);
|
|
509
|
-
}
|
|
510
|
-
return;
|
|
511
|
-
}
|
|
512
|
-
const corrected = /* @__PURE__ */ new Map();
|
|
513
|
-
countTableSpellings(corrected, table, tokenTable);
|
|
514
|
-
const removed = /* @__PURE__ */ new Map();
|
|
515
|
-
const returned = [];
|
|
516
|
-
for (let ordinal = 0; ordinal < mergedOrdinals.length; ordinal++) {
|
|
517
|
-
const kept = mergedOrdinals[ordinal] >= 0;
|
|
518
|
-
if (kept === isCounted(ordinal)) continue;
|
|
519
|
-
if (kept) returned.push(ordinal);
|
|
520
|
-
else countRemovedSpellings(removed, documents.documentAt(ordinal), analysis);
|
|
521
|
-
}
|
|
522
|
-
subtractRemovedSpellings(corrected, removed, analysis);
|
|
523
|
-
for (const ordinal of returned) countDocumentSpellings(corrected, documents.documentAt(ordinal), analysis, 1);
|
|
524
|
-
addCounts(counts, corrected);
|
|
525
|
-
},
|
|
526
|
-
spellings() {
|
|
527
|
-
return null;
|
|
528
|
-
},
|
|
529
|
-
bytes() {
|
|
530
|
-
if (table === null) return 0;
|
|
531
|
-
return partialWordTableBytes(table) + removedCounts.size * FROZEN_PARTIAL_REMOVED_ENTRY_BYTES;
|
|
532
|
-
}
|
|
533
|
-
};
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
// src/core/partition/partial-words/growing-slot.ts
|
|
537
|
-
function createGrowingPartialWordSlot(view) {
|
|
538
|
-
let fields = [];
|
|
539
|
-
let everyDocumentPending = false;
|
|
540
|
-
const pending = /* @__PURE__ */ new Set();
|
|
541
|
-
const entriesByToken = /* @__PURE__ */ new Map();
|
|
542
|
-
const entrySpellings = [];
|
|
543
|
-
const entryTokens = [];
|
|
544
|
-
const entryLengths = [];
|
|
545
|
-
const entryCounts = [];
|
|
546
|
-
const entryInRuns = [];
|
|
547
|
-
const freeEntries = [];
|
|
548
|
-
const entriesOutsideRuns = [];
|
|
549
|
-
const runs = /* @__PURE__ */ new Map();
|
|
550
|
-
let liveEntries = 0;
|
|
551
|
-
let runMembers = 0;
|
|
552
|
-
function resetSpellings() {
|
|
553
|
-
pending.clear();
|
|
554
|
-
entriesByToken.clear();
|
|
555
|
-
entrySpellings.length = 0;
|
|
556
|
-
entryTokens.length = 0;
|
|
557
|
-
entryLengths.length = 0;
|
|
558
|
-
entryCounts.length = 0;
|
|
559
|
-
entryInRuns.length = 0;
|
|
560
|
-
freeEntries.length = 0;
|
|
561
|
-
entriesOutsideRuns.length = 0;
|
|
562
|
-
runs.clear();
|
|
563
|
-
liveEntries = 0;
|
|
564
|
-
runMembers = 0;
|
|
565
|
-
}
|
|
566
|
-
function addEntry(byToken, token, spelling, count) {
|
|
567
|
-
const length = codePointCountOf(spelling);
|
|
568
|
-
if (length <= PARTIAL_WORD_RUN_CODE_POINTS) return;
|
|
569
|
-
const entry = freeEntries.pop() ?? entrySpellings.length;
|
|
570
|
-
entrySpellings[entry] = spelling;
|
|
571
|
-
entryTokens[entry] = token;
|
|
572
|
-
entryLengths[entry] = length;
|
|
573
|
-
entryCounts[entry] = count;
|
|
574
|
-
entryInRuns[entry] = false;
|
|
575
|
-
entriesOutsideRuns.push(entry);
|
|
576
|
-
if (entriesOutsideRuns.length > GROWING_PARTIAL_PENDING_ENTRIES_PER_ENTRY * entrySpellings.length) {
|
|
577
|
-
dropFreedAndRepeatedPendingEntries();
|
|
578
|
-
}
|
|
579
|
-
byToken.set(spelling, entry);
|
|
580
|
-
liveEntries++;
|
|
581
|
-
}
|
|
582
|
-
function dropFreedAndRepeatedPendingEntries() {
|
|
583
|
-
let kept = 0;
|
|
584
|
-
for (const entry of entriesOutsideRuns) {
|
|
585
|
-
if (entryLengths[entry] === 0 || entryInRuns[entry]) continue;
|
|
586
|
-
entryInRuns[entry] = true;
|
|
587
|
-
entriesOutsideRuns[kept++] = entry;
|
|
588
|
-
}
|
|
589
|
-
entriesOutsideRuns.length = kept;
|
|
590
|
-
for (let at = 0; at < kept; at++) entryInRuns[entriesOutsideRuns[at]] = false;
|
|
591
|
-
}
|
|
592
|
-
function addToRuns(entry) {
|
|
593
|
-
const points = codePointsOf(entrySpellings[entry]);
|
|
594
|
-
for (let at = 0; at + PARTIAL_WORD_RUN_CODE_POINTS <= points.length; at++) {
|
|
595
|
-
const key = packedRunKeyAt(points, at);
|
|
596
|
-
let members = runs.get(key);
|
|
597
|
-
if (members === void 0) {
|
|
598
|
-
members = /* @__PURE__ */ new Set();
|
|
599
|
-
runs.set(key, members);
|
|
600
|
-
}
|
|
601
|
-
const size = members.size;
|
|
602
|
-
members.add(entry);
|
|
603
|
-
if (members.size !== size) runMembers++;
|
|
604
|
-
}
|
|
605
|
-
entryInRuns[entry] = true;
|
|
606
|
-
}
|
|
607
|
-
function addEntriesToRuns() {
|
|
608
|
-
for (const entry of entriesOutsideRuns) {
|
|
609
|
-
if (entryLengths[entry] > 0 && !entryInRuns[entry]) addToRuns(entry);
|
|
610
|
-
}
|
|
611
|
-
entriesOutsideRuns.length = 0;
|
|
612
|
-
}
|
|
613
|
-
function removeFromRuns(entry) {
|
|
614
|
-
const points = codePointsOf(entrySpellings[entry]);
|
|
615
|
-
for (let at = 0; at + PARTIAL_WORD_RUN_CODE_POINTS <= points.length; at++) {
|
|
616
|
-
const key = packedRunKeyAt(points, at);
|
|
617
|
-
const members = runs.get(key);
|
|
618
|
-
if (members === void 0 || !members.delete(entry)) continue;
|
|
619
|
-
runMembers--;
|
|
620
|
-
if (members.size === 0) runs.delete(key);
|
|
621
|
-
}
|
|
622
|
-
entryInRuns[entry] = false;
|
|
623
|
-
}
|
|
624
|
-
function removeEntry(byToken, token, spelling, entry) {
|
|
625
|
-
if (entryInRuns[entry]) removeFromRuns(entry);
|
|
626
|
-
byToken.delete(spelling);
|
|
627
|
-
if (byToken.size === 0) entriesByToken.delete(token);
|
|
628
|
-
entrySpellings[entry] = "";
|
|
629
|
-
entryTokens[entry] = "";
|
|
630
|
-
entryLengths[entry] = 0;
|
|
631
|
-
entryCounts[entry] = 0;
|
|
632
|
-
freeEntries.push(entry);
|
|
633
|
-
liveEntries--;
|
|
634
|
-
}
|
|
635
|
-
function change(token, spelling, delta) {
|
|
636
|
-
let byToken = entriesByToken.get(token);
|
|
637
|
-
const entry = byToken?.get(spelling);
|
|
638
|
-
if (byToken !== void 0 && entry !== void 0) {
|
|
639
|
-
const after = entryCounts[entry] + delta;
|
|
640
|
-
if (after > 0) entryCounts[entry] = after;
|
|
641
|
-
else removeEntry(byToken, token, spelling, entry);
|
|
642
|
-
return;
|
|
643
|
-
}
|
|
644
|
-
if (delta <= 0) return;
|
|
645
|
-
if (byToken === void 0) {
|
|
646
|
-
byToken = /* @__PURE__ */ new Map();
|
|
647
|
-
entriesByToken.set(token, byToken);
|
|
648
|
-
}
|
|
649
|
-
addEntry(byToken, token, spelling, delta);
|
|
650
|
-
if (byToken.size === 0) entriesByToken.delete(token);
|
|
651
|
-
}
|
|
652
|
-
function encodedSpellings() {
|
|
653
|
-
const encoded = { fields: [...fields], tokens: [], spellings: [], counts: [] };
|
|
654
|
-
for (const [token, byToken] of entriesByToken) {
|
|
655
|
-
for (const [spelling, entry] of byToken) {
|
|
656
|
-
encoded.tokens.push(token);
|
|
657
|
-
encoded.spellings.push(spelling);
|
|
658
|
-
encoded.counts.push(entryCounts[entry]);
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
return encoded;
|
|
662
|
-
}
|
|
663
|
-
function applyCounts(source, direction) {
|
|
664
|
-
for (const [token, byToken] of source) {
|
|
665
|
-
for (const [spelling, count] of byToken) change(token, spelling, count * direction);
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
function adoptFields(next) {
|
|
669
|
-
if (sameFields(fields, next)) return;
|
|
670
|
-
fields = [...next];
|
|
671
|
-
resetSpellings();
|
|
672
|
-
everyDocumentPending = fields.length > 0;
|
|
673
|
-
}
|
|
674
|
-
function documentAt(internalId) {
|
|
675
|
-
const docId = view.docStore.getExternalId(internalId);
|
|
676
|
-
return docId === void 0 ? void 0 : view.docStore.get(docId)?.fields;
|
|
677
|
-
}
|
|
678
|
-
function resolvePending(analysis) {
|
|
679
|
-
if (everyDocumentPending) {
|
|
680
|
-
resetSpellings();
|
|
681
|
-
const derived2 = /* @__PURE__ */ new Map();
|
|
682
|
-
for (const [, stored] of view.docStore.all()) countDocumentSpellings(derived2, stored.fields, analysis, 1);
|
|
683
|
-
applyCounts(derived2, 1);
|
|
684
|
-
everyDocumentPending = false;
|
|
685
|
-
return;
|
|
686
|
-
}
|
|
687
|
-
if (pending.size === 0) return;
|
|
688
|
-
const derived = /* @__PURE__ */ new Map();
|
|
689
|
-
for (const internalId of pending) {
|
|
690
|
-
const document = documentAt(internalId);
|
|
691
|
-
if (document !== void 0) countDocumentSpellings(derived, document, analysis, 1);
|
|
692
|
-
}
|
|
693
|
-
pending.clear();
|
|
694
|
-
applyCounts(derived, 1);
|
|
695
|
-
}
|
|
696
|
-
const reader = {
|
|
697
|
-
forEachContaining(probe, visit) {
|
|
698
|
-
const points = probe.codePoints;
|
|
699
|
-
if (points.length < PARTIAL_WORD_RUN_CODE_POINTS) return;
|
|
700
|
-
let narrowest = null;
|
|
701
|
-
for (let at = 0; at + PARTIAL_WORD_RUN_CODE_POINTS <= points.length; at++) {
|
|
702
|
-
const members = runs.get(packedRunKeyAt(points, at));
|
|
703
|
-
if (members === void 0) return;
|
|
704
|
-
if (narrowest === null || members.size < narrowest.size) narrowest = members;
|
|
705
|
-
}
|
|
706
|
-
if (narrowest === null) return;
|
|
707
|
-
for (const entry of narrowest) {
|
|
708
|
-
const length = entryLengths[entry];
|
|
709
|
-
if (length <= points.length) continue;
|
|
710
|
-
if (!entrySpellings[entry].includes(probe.text)) continue;
|
|
711
|
-
visit(entryTokens[entry], length);
|
|
712
|
-
}
|
|
713
|
-
},
|
|
714
|
-
bytes() {
|
|
715
|
-
return slot.bytes();
|
|
716
|
-
}
|
|
717
|
-
};
|
|
718
|
-
const slot = {
|
|
719
|
-
readerFor(analysis) {
|
|
720
|
-
if (analysis.fields.length === 0) return null;
|
|
721
|
-
adoptFields(analysis.fields);
|
|
722
|
-
resolvePending(analysis);
|
|
723
|
-
addEntriesToRuns();
|
|
724
|
-
return reader;
|
|
725
|
-
},
|
|
726
|
-
spellings() {
|
|
727
|
-
if (fields.length === 0 || everyDocumentPending || pending.size > 0) return null;
|
|
728
|
-
return encodedSpellings();
|
|
729
|
-
},
|
|
730
|
-
afterDocument(documentFields, internalId, spellings, direction) {
|
|
731
|
-
if (documentFields.length === 0) return;
|
|
732
|
-
if (!sameFields(fields, documentFields)) {
|
|
733
|
-
const holdsOnlyThisDocument = direction === 1 && view.docStore.count() === 1;
|
|
734
|
-
adoptFields(documentFields);
|
|
735
|
-
if (holdsOnlyThisDocument) everyDocumentPending = false;
|
|
736
|
-
}
|
|
737
|
-
if (everyDocumentPending) return;
|
|
738
|
-
if (direction === -1 && pending.delete(internalId)) return;
|
|
739
|
-
if (spellings !== null) {
|
|
740
|
-
applyCounts(spellings, direction);
|
|
741
|
-
} else if (direction === 1) {
|
|
742
|
-
pending.add(internalId);
|
|
743
|
-
} else {
|
|
744
|
-
everyDocumentPending = true;
|
|
745
|
-
}
|
|
746
|
-
},
|
|
747
|
-
afterMerge(spellings, internalIds) {
|
|
748
|
-
if (internalIds.length === 0) return;
|
|
749
|
-
if (fields.length === 0 && spellings !== null && view.docStore.count() === internalIds.length) {
|
|
750
|
-
adoptFields(spellings.fields);
|
|
751
|
-
everyDocumentPending = false;
|
|
752
|
-
}
|
|
753
|
-
if (fields.length === 0 || everyDocumentPending) return;
|
|
754
|
-
if (spellings === null || !sameFields(fields, spellings.fields)) {
|
|
755
|
-
for (const internalId of internalIds) pending.add(internalId);
|
|
756
|
-
return;
|
|
757
|
-
}
|
|
758
|
-
for (let at = 0; at < spellings.tokens.length; at++) {
|
|
759
|
-
change(spellings.tokens[at], spellings.spellings[at], spellings.counts[at]);
|
|
760
|
-
}
|
|
761
|
-
},
|
|
762
|
-
forgetSpellings() {
|
|
763
|
-
resetSpellings();
|
|
764
|
-
everyDocumentPending = fields.length > 0;
|
|
765
|
-
},
|
|
766
|
-
clear() {
|
|
767
|
-
fields = [];
|
|
768
|
-
everyDocumentPending = false;
|
|
769
|
-
resetSpellings();
|
|
770
|
-
},
|
|
771
|
-
bytes() {
|
|
772
|
-
return liveEntries * GROWING_PARTIAL_ENTRY_BYTES + runs.size * GROWING_PARTIAL_RUN_BYTES + runMembers * GROWING_PARTIAL_RUN_MEMBER_BYTES + entriesOutsideRuns.length * GROWING_PARTIAL_PENDING_ENTRY_BYTES;
|
|
773
|
-
}
|
|
774
|
-
};
|
|
775
|
-
return slot;
|
|
776
|
-
}
|
|
777
|
-
|
|
778
|
-
// src/core/partition/partial-words/highlight.ts
|
|
779
|
-
function containsPartialWord(spelling, words) {
|
|
780
|
-
for (const word of words) {
|
|
781
|
-
if (spelling.length > word.length && spelling.includes(word)) return true;
|
|
782
|
-
}
|
|
783
|
-
return false;
|
|
784
|
-
}
|
|
785
|
-
function partialWordMatcher(text, language, partial) {
|
|
786
|
-
const indexed = tokenize(text, language, {
|
|
787
|
-
stem: true,
|
|
788
|
-
removeStopWords: true,
|
|
789
|
-
collectSurfaces: true,
|
|
790
|
-
customTokenizer: partial.customTokenizer,
|
|
791
|
-
stopWordOverride: partial.stopWordOverride
|
|
792
|
-
});
|
|
793
|
-
const positions = /* @__PURE__ */ new Set();
|
|
794
|
-
const spellings = /* @__PURE__ */ new Set();
|
|
795
|
-
for (let at = 0; at < indexed.tokens.length; at++) {
|
|
796
|
-
const spelling = indexed.surfaces?.[at] ?? indexed.tokens[at].token;
|
|
797
|
-
if (!containsPartialWord(spelling, partial.words)) continue;
|
|
798
|
-
positions.add(indexed.tokens[at].position);
|
|
799
|
-
spellings.add(spelling);
|
|
800
|
-
}
|
|
801
|
-
if (partial.customTokenizer !== void 0) return (_position, fieldToken) => spellings.has(fieldToken);
|
|
802
|
-
return (position) => positions.has(position);
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
// src/core/partition/partial-words/query.ts
|
|
806
|
-
function addPartialWords(group, added) {
|
|
807
|
-
const membersByToken = /* @__PURE__ */ new Map();
|
|
808
|
-
for (const member of group.members) membersByToken.set(member.token, member);
|
|
809
|
-
for (const word of added) {
|
|
810
|
-
const member = membersByToken.get(word.token);
|
|
811
|
-
if (member === void 0) {
|
|
812
|
-
group.members.push({ token: word.token, factor: 0, partialFactor: word.factor });
|
|
813
|
-
} else if (word.factor > member.partialFactor) {
|
|
814
|
-
member.partialFactor = word.factor;
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
function partialWordRequests(query) {
|
|
819
|
-
const eligible = [];
|
|
820
|
-
for (const queryToken of query.queryTokens) {
|
|
821
|
-
const word = query.written.get(queryToken.position);
|
|
822
|
-
if (word === void 0 || codePointCount(word) < PARTIAL_WORD_MIN_CODE_POINTS) continue;
|
|
823
|
-
eligible.push({ token: queryToken.token, written: word });
|
|
824
|
-
if (eligible.length === PARTIAL_WORDS_ADDED_PER_QUERY) break;
|
|
825
|
-
}
|
|
826
|
-
const count = eligible.length;
|
|
827
|
-
if (count === 0) return [];
|
|
828
|
-
const evenShare = Math.floor(PARTIAL_WORDS_ADDED_PER_QUERY / count);
|
|
829
|
-
const remainder = PARTIAL_WORDS_ADDED_PER_QUERY % count;
|
|
830
|
-
return eligible.map((entry, order) => ({
|
|
831
|
-
token: entry.token,
|
|
832
|
-
request: {
|
|
833
|
-
written: entry.written,
|
|
834
|
-
ownToken: entry.token,
|
|
835
|
-
share: evenShare + (order < remainder ? 1 : 0),
|
|
836
|
-
tolerance: entry.token === query.prefixToken ? 0 : query.tolerance,
|
|
837
|
-
prefixLength: query.prefixLength ?? DEFAULT_FUZZY_PREFIX_LENGTH
|
|
838
|
-
}
|
|
839
|
-
}));
|
|
840
|
-
}
|
|
841
|
-
function addPartialWordMembers(query, expand, groupOf) {
|
|
842
|
-
const requests = partialWordRequests(query);
|
|
843
|
-
const added = expand(
|
|
844
|
-
query.analysis,
|
|
845
|
-
requests.map((entry) => entry.request)
|
|
846
|
-
);
|
|
847
|
-
for (let at = 0; at < requests.length; at++) {
|
|
848
|
-
if (added[at].length === 0) continue;
|
|
849
|
-
const token = requests[at].token;
|
|
850
|
-
addPartialWords(groupOf(token, token !== query.prefixToken), added[at]);
|
|
851
|
-
}
|
|
852
|
-
}
|
|
853
|
-
function partialWordsToHighlight(queryTokens, writtenWords) {
|
|
854
|
-
const writtenAt = /* @__PURE__ */ new Map();
|
|
855
|
-
for (const word of writtenWords) {
|
|
856
|
-
if (!writtenAt.has(word.position)) writtenAt.set(word.position, word.token);
|
|
857
|
-
}
|
|
858
|
-
const seenTokens = /* @__PURE__ */ new Set();
|
|
859
|
-
const words = [];
|
|
860
|
-
for (const queryToken of queryTokens) {
|
|
861
|
-
if (seenTokens.has(queryToken.token)) continue;
|
|
862
|
-
seenTokens.add(queryToken.token);
|
|
863
|
-
const word = writtenAt.get(queryToken.position);
|
|
864
|
-
if (word === void 0 || codePointCount(word) < PARTIAL_WORD_MIN_CODE_POINTS) continue;
|
|
865
|
-
words.push(word);
|
|
866
|
-
if (words.length === PARTIAL_WORDS_ADDED_PER_QUERY) break;
|
|
867
|
-
}
|
|
868
|
-
return words;
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
// src/core/partition/partial-words/module.ts
|
|
872
|
-
var partialWordSearchModule = {
|
|
873
|
-
name: "partialWords",
|
|
874
|
-
createGrowingSlot: createGrowingPartialWordSlot,
|
|
875
|
-
createFrozenSlot: createFrozenPartialWordSlot,
|
|
876
|
-
buildTable: buildPartialWordTable,
|
|
877
|
-
expand: expandPartialWords,
|
|
878
|
-
countSpelling,
|
|
879
|
-
encodeSpellings: encodePartialSpellings,
|
|
880
|
-
spellingCountsOf,
|
|
881
|
-
highlightMatcher: partialWordMatcher,
|
|
882
|
-
addTermMembers: addPartialWordMembers,
|
|
883
|
-
highlightWords: partialWordsToHighlight
|
|
884
|
-
};
|
|
885
|
-
|
|
886
|
-
export { expandTermPrefix, partialWordSearchModule, partitionDocumentFrequency, sameFields, suggestDisplayTerms, visitDocumentSpellings, visitDocumentSurfaceSpellings };
|