@shaxpir/duiduidui-models 1.33.0 → 1.34.0

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.
@@ -30,6 +30,8 @@ export interface TokenizedSearch {
30
30
  ambiguousTokens: SearchToken[];
31
31
  hasHanzi: boolean;
32
32
  hasPinyin: boolean;
33
+ /** True only when input contains definite pinyin (tone marks). False for ambiguous tokens like 'time' that could be English. */
34
+ hasDefinitePinyin: boolean;
33
35
  hasEnglish: boolean;
34
36
  }
35
37
  /**
@@ -32,6 +32,7 @@ class SearchTokenizer {
32
32
  ambiguousTokens: [],
33
33
  hasHanzi: false,
34
34
  hasPinyin: false,
35
+ hasDefinitePinyin: false,
35
36
  hasEnglish: false
36
37
  };
37
38
  }
@@ -52,6 +53,7 @@ class SearchTokenizer {
52
53
  ambiguousTokens,
53
54
  hasHanzi: hanziTokens.length > 0,
54
55
  hasPinyin: pinyinTokens.length > 0 || ambiguousTokens.some(t => t.isPossiblePinyin),
56
+ hasDefinitePinyin: pinyinTokens.length > 0, // Only true for tokens with tone marks
55
57
  hasEnglish: englishTokens.length > 0 || ambiguousTokens.length > 0
56
58
  };
57
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shaxpir/duiduidui-models",
3
- "version": "1.33.0",
3
+ "version": "1.34.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/shaxpir/duiduidui-models"