sudachi-ts 0.1.16 → 0.1.18

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.
@@ -8,5 +8,5 @@ export declare class SimpleOovProviderPlugin extends OovProviderPlugin {
8
8
  private rightId;
9
9
  private cost;
10
10
  setUp(grammar: Grammar): void;
11
- provideOOV(inputText: InputText, _offset: number, otherWords: number, result: LatticeNodeImpl[]): number;
11
+ provideOOV(inputText: InputText, offset: number, otherWords: number, result: LatticeNodeImpl[]): number;
12
12
  }
@@ -18,12 +18,12 @@ export class SimpleOovProviderPlugin extends OovProviderPlugin {
18
18
  const userPosMode = this.settings.getString(OovProviderPlugin.USER_POS, OovProviderPlugin.USER_POS_FORBID) ?? OovProviderPlugin.USER_POS_FORBID;
19
19
  this.oovPOSId = this.posIdOf(grammar, pos, userPosMode);
20
20
  }
21
- provideOOV(inputText, _offset, otherWords, result) {
21
+ provideOOV(inputText, offset, otherWords, result) {
22
22
  if (otherWords === 0) {
23
23
  const node = this.createNode();
24
24
  node.setParameter(this.leftId, this.rightId, this.cost);
25
- const length = inputText.getWordCandidateLength(0);
26
- const s = inputText.getSubstring(0, length);
25
+ const length = inputText.getWordCandidateLength(offset);
26
+ const s = inputText.getSubstring(offset, offset + length);
27
27
  const info = new WordInfo(s, length, this.oovPOSId, s, s, '');
28
28
  node.setWordInfo(info);
29
29
  result.push(node);
@@ -1974,6 +1974,15 @@ const VERB_SEQUENCE_RULES = [
1974
1974
  },
1975
1975
  ];
1976
1976
  const PHRASE_SEQUENCE_RULES = [
1977
+ {
1978
+ name: 'na_adjective_attributive',
1979
+ priority: 75,
1980
+ resultType: 'phrase',
1981
+ pattern: [
1982
+ { pos0: '形状詞' },
1983
+ { surface: 'な', dictionaryForm: 'だ', pos0: '助動詞' },
1984
+ ],
1985
+ },
1977
1986
  {
1978
1987
  name: 'noun_teki_suffix',
1979
1988
  priority: 75,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sudachi-ts",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "description": "TypeScript port of Sudachi morphological analyzer for Japanese text",
5
5
  "keywords": [
6
6
  "morphological-analyzer",