thaizip 0.7.2 → 0.7.3
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/LICENSE +21 -0
- package/README.md +5 -1
- package/dist/data.cjs +46 -6
- package/dist/data.d.cts +9 -0
- package/dist/data.d.ts +9 -0
- package/dist/data.js +46 -6
- package/dist/index.cjs +96 -17
- package/dist/index.d.cts +33 -2
- package/dist/index.d.ts +33 -2
- package/dist/index.js +96 -17
- package/dist/react.cjs +62 -31
- package/dist/react.d.cts +9 -0
- package/dist/react.d.ts +9 -0
- package/dist/react.js +62 -31
- package/package.json +5 -2
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/react.cjs.map +0 -1
- package/dist/react.js.map +0 -1
package/dist/data.d.cts
CHANGED
|
@@ -14,6 +14,15 @@ type TrigramIndex = {
|
|
|
14
14
|
map: Map<string, Set<number>>;
|
|
15
15
|
records: ThaiAddressRecord[];
|
|
16
16
|
zipIndex: Map<string, number[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Zip codes of `zipIndex` in ascending lexical order, with postings
|
|
19
|
+
* parallel in `sortedZipPostings`. Used by `lookupByZipCode` for
|
|
20
|
+
* O(log n + matches) prefix lookup instead of scanning every zip code.
|
|
21
|
+
* Optional: older-shaped or hand-built indexes without these fields fall
|
|
22
|
+
* back to the O(n_zips) scan.
|
|
23
|
+
*/
|
|
24
|
+
sortedZipKeys?: string[];
|
|
25
|
+
sortedZipPostings?: number[][];
|
|
17
26
|
/**
|
|
18
27
|
* Normalized Thai tambon names, parallel to `records` (same index).
|
|
19
28
|
* Used by the search ranker for exact/prefix match detection without
|
package/dist/data.d.ts
CHANGED
|
@@ -14,6 +14,15 @@ type TrigramIndex = {
|
|
|
14
14
|
map: Map<string, Set<number>>;
|
|
15
15
|
records: ThaiAddressRecord[];
|
|
16
16
|
zipIndex: Map<string, number[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Zip codes of `zipIndex` in ascending lexical order, with postings
|
|
19
|
+
* parallel in `sortedZipPostings`. Used by `lookupByZipCode` for
|
|
20
|
+
* O(log n + matches) prefix lookup instead of scanning every zip code.
|
|
21
|
+
* Optional: older-shaped or hand-built indexes without these fields fall
|
|
22
|
+
* back to the O(n_zips) scan.
|
|
23
|
+
*/
|
|
24
|
+
sortedZipKeys?: string[];
|
|
25
|
+
sortedZipPostings?: number[][];
|
|
17
26
|
/**
|
|
18
27
|
* Normalized Thai tambon names, parallel to `records` (same index).
|
|
19
28
|
* Used by the search ranker for exact/prefix match detection without
|