|
1 |
| -// Type definitions for Natural 0.2.1 |
| 1 | +// Type definitions for Natural 0.2.2 |
2 | 2 | // Project: https://github.com/NaturalNode/natural
|
3 | 3 | // Definitions by: Dylan R. E. Moonfire <https://github.com/dmoonfire/>
|
4 | 4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
@@ -202,3 +202,40 @@ declare class Spellcheck {
|
202 | 202 | isCorrect(word: string): boolean;
|
203 | 203 | getCorrections(word: string, maxDistance?: number): string[];
|
204 | 204 | }
|
| 205 | + |
| 206 | +declare class Predicate { |
| 207 | + constructor(name: string, parameter1: string, parameter2?: string); |
| 208 | + name: string; |
| 209 | + parameter1: string; |
| 210 | + parameter2?: string; |
| 211 | + function?: (tagged_sentence: string[][], i: number, parameter: string) => boolean; |
| 212 | + evaluate(tagged_sentence: string[][], position: number): boolean; |
| 213 | +} |
| 214 | + |
| 215 | +declare class TransformationRule { |
| 216 | + constructor(c1: string, c2: string, predicate: string, parameter1: string, parameter2?: string); |
| 217 | + literal: string[]; |
| 218 | + predicate: Predicate; |
| 219 | + old_category: string; |
| 220 | + new_category: string; |
| 221 | + apply(tagged_sentence: string[][], position: number): void; |
| 222 | +} |
| 223 | + |
| 224 | +declare class RuleSet { |
| 225 | + constructor(filename: string); |
| 226 | + rules: TransformationRule[]; |
| 227 | +} |
| 228 | + |
| 229 | +declare class Lexicon { |
| 230 | + constructor(filename: string, defaultCategory: string); |
| 231 | + defaultCategory: string; |
| 232 | + parseLexicon(data: string): void; |
| 233 | + tagWord(word: string): string[]; |
| 234 | +} |
| 235 | + |
| 236 | +declare class BrillPOSTagger { |
| 237 | + constructor(lexicon: Lexicon, ruleSet: RuleSet); |
| 238 | + lexicon: Lexicon; |
| 239 | + ruleSet: RuleSet; |
| 240 | + tag(sentence: string[]): string[][]; |
| 241 | +} |
0 commit comments