Skip to content

Commit 5fc7dbe

Browse files
committed
Update stopwords types
1 parent 1d8460b commit 5fc7dbe

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

specification/_types/analysis/StopWords.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* under the License.
1818
*/
1919

20-
export enum StopWord {
20+
export enum StopWordLanguage {
2121
_arabic_,
2222
_armenian_,
2323
_basque_,
@@ -53,7 +53,8 @@ export enum StopWord {
5353
_spanish_,
5454
_swedish_,
5555
_thai_,
56-
_turkish_
56+
_turkish_,
57+
_none_
5758
}
5859

5960
/**
@@ -62,4 +63,4 @@ export enum StopWord {
6263
* Also accepts an array of stop words.
6364
* @class_serializer: StopWordsFormatter
6465
*/
65-
export type StopWords = StopWord | StopWord[]
66+
export type StopWords = string | string[]

specification/_types/analysis/analyzers.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { IcuAnalyzer } from './icu-plugin'
2323
import { KuromojiAnalyzer } from './kuromoji-plugin'
2424
import { SnowballLanguage } from './languages'
2525
import { NoriDecompoundMode } from './nori-plugin'
26-
import { StopWords } from './StopWords'
26+
import { StopWords, StopWordLanguage } from './StopWords'
2727

2828
export class CustomAnalyzer {
2929
type: 'custom'
@@ -56,7 +56,7 @@ export class FingerprintAnalyzer {
5656
*
5757
* @server_default _none_
5858
*/
59-
stopwords?: StopWords
59+
stopwords?: StopWordLanguage | string[]
6060
/**
6161
* The path to a file containing stop words.
6262
*/
@@ -357,7 +357,7 @@ export class PatternAnalyzer {
357357
*
358358
* @server_default _none_
359359
*/
360-
stopwords?: StopWords
360+
stopwords?: StopWordLanguage | string[]
361361
/**
362362
* The path to a file containing stop words.
363363
*/
@@ -394,7 +394,7 @@ export class StandardAnalyzer {
394394
*
395395
* @server_default _none_
396396
*/
397-
stopwords?: StopWords
397+
stopwords?: StopWordLanguage | string[]
398398
/**
399399
* The path to a file containing stop words.
400400
*/
@@ -411,7 +411,7 @@ export class StopAnalyzer {
411411
*
412412
* @server_default _none_
413413
*/
414-
stopwords?: StopWords
414+
stopwords?: StopWordLanguage | string[]
415415
/**
416416
* The path to a file containing stop words.
417417
*/

specification/_types/analysis/token_filters.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import {
3636
import { SnowballLanguage } from './languages'
3737
import { NoriPartOfSpeechTokenFilter } from './nori-plugin'
3838
import { PhoneticTokenFilter } from './phonetic-plugin'
39-
import { StopWords } from './StopWords'
39+
import { StopWordLanguage } from './StopWords'
4040

4141
export class TokenFilterBase {
4242
version?: VersionString
@@ -129,7 +129,7 @@ export class StopTokenFilter extends TokenFilterBase {
129129
/** If `true`, the last token of a stream is removed if it’s a stop word. Defaults to `true`. */
130130
remove_trailing?: boolean
131131
/** Language value, such as `_arabic_` or `_thai_`. Defaults to `_english_`. */
132-
stopwords?: StopWords
132+
stopwords?: StopWordLanguage | string[]
133133
/** Path to a file that contains a list of stop words to remove.
134134
* This path must be absolute or relative to the `config` location, and the file must be UTF-8 encoded. Each stop word in the file must be separated by a line break. */
135135
stopwords_path?: string

0 commit comments

Comments
 (0)