Skip to content

Commit

Permalink
chore(nlp): Czech tokenizer, stemmer and stopwords added
Browse files Browse the repository at this point in the history
  • Loading branch information
elozano98 committed Nov 19, 2020
1 parent 4f37d1c commit 8138d47
Show file tree
Hide file tree
Showing 9 changed files with 469 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/botonic-plugin-contentful/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/botonic-plugin-contentful/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"@nlpjs/lang-ru": "^4.14.0",
"@nlpjs/lang-tr": "^4.14.0",
"@nlpjs/lang-el": "^4.14.0",
"@nlpjs/lang-cs": "^4.14.0",
"@nlpjs/ner": "^4.14.0",
"@nlpjs/similarity": "^4.14.0",
"@types/joi": "^14.3.4",
Expand Down
2 changes: 2 additions & 0 deletions packages/botonic-plugin-contentful/src/nlp/locales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const FRENCH = 'fr'
export const GERMAN = 'de'
export const ROMANIAN = 'ro'
export const GREEK = 'el'
export const CZECH = 'cs'

export const SUPPORTED_LOCALES = [
SPANISH,
Expand All @@ -28,6 +29,7 @@ export const SUPPORTED_LOCALES = [
GERMAN,
ROMANIAN,
GREEK,
CZECH,
]

export function checkLocale(locale: Locale): Locale {
Expand Down
2 changes: 2 additions & 0 deletions packages/botonic-plugin-contentful/src/nlp/stemmer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Stemmer } from '@nlpjs/core/src'
import StemmerCa from '@nlpjs/lang-ca/src/stemmer-ca'
import StemmerCs from '@nlpjs/lang-cs/src/stemmer-cs'
import StemmerDe from '@nlpjs/lang-de/src/stemmer-de'
import StemmerEl from '@nlpjs/lang-el/src/stemmer-el'
import StemmerEn from '@nlpjs/lang-en-min/src/stemmer-en'
Expand Down Expand Up @@ -32,6 +33,7 @@ export const stemmers: { [key: string]: Stemmer } = {
de: new StemmerDe(),
ro: new StemmerRo(),
el: new StemmerEl(),
cs: new StemmerCs(),
}

export function stemmerFor(locale: Locale): Stemmer {
Expand Down
Loading

0 comments on commit 8138d47

Please sign in to comment.