thaizip 0.7.2 → 0.7.4

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/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