File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed
lib/natural/brill_pos_tagger/lib Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -24,18 +24,20 @@ const dutchLexicon = require('../data/Dutch/brill_Lexicon.json')
2424const DEBUG = false
2525
2626// Constructor creates a Lexicon for language
27- function Lexicon ( language , defaultCategory , defaultCategoryCapitalised ) {
28- switch ( language ) {
29- case 'EN' :
30- this . lexicon = englishLexicon
31- break
32- case 'DU' :
33- this . lexicon = dutchLexicon
34- break
35- default :
36- this . lexicon = dutchLexicon
37- break
38- }
27+ function Lexicon ( language , defaultCategory , defaultCategoryCapitalised , extendedLexicon ) {
28+ const lexicon = ( ( ) => {
29+ switch ( language ) {
30+ case 'EN' :
31+ return englishLexicon
32+ case 'DU' :
33+ return dutchLexicon
34+ default :
35+ return dutchLexicon
36+ }
37+ } ) ( )
38+
39+ this . lexicon = Object . assign ( lexicon , extendedLexicon || { } )
40+
3941 if ( defaultCategory ) {
4042 this . defaultCategory = defaultCategory
4143 if ( defaultCategoryCapitalised ) {
You can’t perform that action at this time.
0 commit comments