rita 3.0.22 → 3.0.25

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/rita.d.ts ADDED
@@ -0,0 +1,253 @@
1
+ export class RiTa {
2
+ static grammar(rules?: object, context?: object): any;
3
+ static addTransform(name: string, definition: object): void;
4
+ static removeTransform(name: string): void;
5
+ static getTransforms(): string[];
6
+ static articlize(word: string): string;
7
+ static evaluate(script: string, context?: object, options?: {
8
+ trace?: boolean;
9
+ }): string;
10
+ static markov(n: number, options?: {
11
+ text?: string | string[];
12
+ maxLengthMatch?: number;
13
+ maxAttempts?: number;
14
+ tokenize?: object;
15
+ untokenize?: object;
16
+ disableInputChecks?: boolean;
17
+ trace?: boolean;
18
+ }): RiMarkov;
19
+ static kwic(keyword: string, options?: {
20
+ numWords?: number;
21
+ text?: string;
22
+ words?: string[];
23
+ }): string[];
24
+ static kwic(keyword: string, text: number): string[];
25
+ static concordance(text: string, options?: {
26
+ ignoreCase?: boolean;
27
+ ignoreStopWords?: boolean;
28
+ ignorePunctuation?: boolean;
29
+ wordsToIgnore?: string[];
30
+ }): object;
31
+ static randomOrdering(array: object[]): object[];
32
+ static randomOrdering(k: number): number[];
33
+ static randomSeed(seed: number): void;
34
+ static isQuestion(sentence: string): boolean;
35
+ static isVowel(char: string): boolean;
36
+ static isConsonant(char: string): boolean;
37
+ static capitalize(string: string): string;
38
+ static randomWord(pattern?: string | RegExp, options?: {
39
+ minLength?: number;
40
+ maxLength?: number;
41
+ numSyllables?: number;
42
+ limit?: number;
43
+ pos?: string;
44
+ pattern?: RegExp;
45
+ type?: string;
46
+ }): string;
47
+ static rhymes(word: string, options?: {
48
+ minLength?: number;
49
+ maxLength?: number;
50
+ numSyllables?: number;
51
+ limit?: number;
52
+ shuffle?: boolean;
53
+ pos?: string;
54
+ }): Promise<string[]>;
55
+ static isRhyme(word1: string, word2: string): boolean;
56
+ static alliterations(word: string, options?: {
57
+ minLength?: number;
58
+ maxLength?: number;
59
+ numSyllables?: number;
60
+ limit?: number;
61
+ shuffle?: boolean;
62
+ pos?: string;
63
+ }): Promise<string[]>;
64
+ static hasWord(word: string, options?: {
65
+ noDerivations?: boolean;
66
+ }): boolean;
67
+ static isAbbrev(input: string, options?: {
68
+ caseSensitive?: boolean;
69
+ }): boolean;
70
+ static isAlliteration(word1: string, word2: string): boolean;
71
+ static spellsLike(word: string, options?: {
72
+ minLength?: number;
73
+ maxLength?: number;
74
+ numSyllables?: number;
75
+ limit?: number;
76
+ shuffle?: boolean;
77
+ pos?: string;
78
+ }): Promise<string[]>;
79
+ static soundsLike(word: string, options?: {
80
+ minLength?: number;
81
+ maxLength?: number;
82
+ numSyllables?: number;
83
+ limit?: number;
84
+ shuffle?: boolean;
85
+ matchSpelling?: boolean;
86
+ pos?: string;
87
+ }): Promise<string[]>;
88
+ static pos(word: string | string[], options?: {
89
+ simple?: boolean;
90
+ }): string | string[];
91
+ static isNoun(word: string): string;
92
+ static isAdjective(word: string): string;
93
+ static isAdverb(word: string): string;
94
+ static isVerb(word: string): string;
95
+ static isPunct(text: string): boolean;
96
+ static posInline(sentence: string, options?: {
97
+ simple?: boolean;
98
+ }): string;
99
+ static singularize(word: string): string;
100
+ static pluralize(word: string): string;
101
+ static search(pattern?: string | RegExp, options?: {
102
+ minLength?: number;
103
+ maxLength?: number;
104
+ numSyllables?: number;
105
+ limit?: number;
106
+ shuffle?: boolean;
107
+ pos?: string;
108
+ type?: string;
109
+ }): Promise<string[]>;
110
+ static tokens(text: string, options?: {
111
+ caseSensitive?: boolean;
112
+ ignoreStopWords?: boolean;
113
+ splitContractions?: boolean;
114
+ includePunct?: boolean;
115
+ sort?: boolean;
116
+ }): string[];
117
+ static tokenize(input: string, options?: {
118
+ regex?: RegExp;
119
+ splitHyphens?: boolean;
120
+ splitContractions?: boolean;
121
+ }): string[];
122
+ static untokenize(input: string[], delim?: string): string;
123
+ static sentences(text: string, pattern?: string | RegExp): string[];
124
+ static isStopWord(word: string): boolean;
125
+ static stem(word: string): string;
126
+ static presentPart(verbWord: string): string;
127
+ static pastPart(verbWord: string): string;
128
+ static conjugate(verbWord: string, options?: {
129
+ tense?: number;
130
+ person?: number;
131
+ number?: number;
132
+ form?: number;
133
+ passive?: boolean;
134
+ progressive?: boolean;
135
+ perfect?: boolean;
136
+ interrogative?: boolean;
137
+ }): string;
138
+ static stresses(input: string, options?: object): string;
139
+ static syllables(input: string, options?: object): string;
140
+ static phones(input: string, options?: object): string;
141
+ static analyze(input: string, options?: {
142
+ simple?: boolean;
143
+ }): object;
144
+ static spellsLikeSync(word: string, options?: {
145
+ minLength?: number;
146
+ maxLength?: number;
147
+ numSyllables?: number;
148
+ limit?: number;
149
+ pos?: string;
150
+ shuffle?: boolean;
151
+ }): string[];
152
+ static soundsLikeSync(word: string, options?: {
153
+ minLength?: number;
154
+ maxLength?: number;
155
+ numSyllables?: number;
156
+ limit?: number;
157
+ matchSpelling?: boolean;
158
+ shuffle?: boolean;
159
+ pos?: string;
160
+ }): string[];
161
+ static rhymesSync(word: string, options?: {
162
+ minLength?: number;
163
+ maxLength?: number;
164
+ numSyllables?: number;
165
+ limit?: number;
166
+ shuffle?: boolean;
167
+ pos?: string;
168
+ }): string[];
169
+ static searchSync(pattern?: string | RegExp, options?: {
170
+ minLength?: number;
171
+ maxLength?: number;
172
+ numSyllables?: number;
173
+ limit?: number;
174
+ shuffle?: boolean;
175
+ pos?: string;
176
+ type?: string;
177
+ }): string[];
178
+ static alliterationsSync(word: string, options?: {
179
+ minLength?: number;
180
+ maxLength?: number;
181
+ numSyllables?: number;
182
+ limit?: number;
183
+ shuffle?: boolean;
184
+ pos?: string;
185
+ }): string[];
186
+ static randi(param1: number, param2?: number): number;
187
+ static random(param1?: number | object[], param2?: number): number | object;
188
+
189
+ static VERSION: string;
190
+ static SILENT: boolean;
191
+ static SILENCE_LTS: boolean;
192
+ static SPLIT_CONTRACTIONS: boolean;
193
+
194
+ static STRESS: string;
195
+ static NOSTRESS: string;
196
+ static PHONE_BOUNDARY: string;
197
+ static WORD_BOUNDARY: string;
198
+ static SYLLABLE_BOUNDARY: string;
199
+ static SENTENCE_BOUNDARY: string;
200
+ static VOWELS: string;
201
+ static PHONES: string[];
202
+ static ABRV: string[];
203
+ static QUESTIONS: string[];
204
+ static STOP_WORDS: string[];
205
+ static MASS_NOUNS: string[];
206
+
207
+ static INFINITIVE: number;
208
+ static FIRST: number;
209
+ static SECOND: number;
210
+ static THIRD: number;
211
+ static PAST: number;
212
+ static PRESENT: number;
213
+ static FUTURE: number;
214
+ static SINGULAR: number;
215
+ static PLURAL: number;
216
+ static NORMAL: number;
217
+ static GERUND: number;
218
+ }
219
+
220
+ export class RiMarkov {
221
+ static fromJSON(json: string): RiMarkov;
222
+ constructor(n?: number, options?: {
223
+ text?: string | string[];
224
+ trace?: boolean;
225
+ maxLengthMatch?: number;
226
+ maxAttempts?: number;
227
+ tokenizer?: object;
228
+ untokenizer?: object;
229
+ disableInputChecks?: boolean;
230
+ });
231
+ n: number;
232
+ addText(text: string | string[], multiplier?: number): RiMarkov;
233
+ generate(count: number, options?: {
234
+ minLength?: number;
235
+ maxLength?: number;
236
+ temperature?: number;
237
+ allowDuplicates?: boolean;
238
+ seed?: string | string[];
239
+ }): string[];
240
+ generate(options?: {
241
+ minLength?: number;
242
+ maxLength?: number;
243
+ temperature?: number;
244
+ allowDuplicates?: boolean;
245
+ seed?: string | string[];
246
+ }): string;
247
+ toJSON(): string;
248
+ completions(pre: string[], post?: string[]): string[];
249
+ probabilities(path: string | string[], temperature?: number): object;
250
+ probability(data: string | string[]): number;
251
+ toString(root: object, sort: boolean): string;
252
+ size(): number;
253
+ }