diff --git a/src/ud-tree/ud-tree/vocabs.js b/src/ud-tree/ud-tree/vocabs.js index 9e55ae0..2f04668 100644 --- a/src/ud-tree/ud-tree/vocabs.js +++ b/src/ud-tree/ud-tree/vocabs.js @@ -1,117 +1,7 @@ export function getXpos(languageCode) { - if (languageCode === "en") { - return [ - "CC", - "CD", - "DT", - "EX", - "FW", - "HYPH", - "IN", - "IN/that", - "JJ", - "JJR", - "JJS", - "LS", - "MD", - "NN", - "NNS", - "NP", - "NPS", - "PDT", - "POS", - "PP", - "PP$", - "RB", - "RBR", - "RBS", - "RP", - "SENT", - "SYM", - "TO", - "UH", - "VB", - "VBD", - "VBG", - "VBN", - "VBP", - "VBZ", - "VH", - "VHD", - "VHG", - "VHN", - "VHP", - "VHZ", - "VV", - "VVD", - "VVG", - "VVN", - "VVP", - "VVZ", - "WDT", - "WP", - "WP$", - "WRB", - "``", - "\'\'", - "(", - ")", - ",", - ":" - ].sort() - } + return XPOS_LABELS } export function getDeprel(languageCode) { - if (languageCode === "en") { - return [ - "nsubj", - "csubj", - "nsubj:pass", - "csubj:pass", - "obj", - "ccomp", - "xcomp", - "iobj", - "advcl", - "advmod", - "neg", - "nmod:npmod", - "nmod:tmod", - "nmod:poss", - "vocative", - "aux", - "mark", - "discourse", - "auxpass", - "expl", - "cop", - "nummod", - "acl", - "amod", - "acl:relcl", - "appos", - "det", - "det:predet", - "nmod", - "compound", - "fixed", - "goeswith", - "compound:prt", - "flat", - "foreign", - "conj", - "cc", - "punct", - "cc:preconj", - "case", - "list", - "parataxis", - "orphan", - "dislocated", - "reparandum", - "root", - "dep" - ].sort() - } + return DEPREL_LABELS } \ No newline at end of file diff --git a/webpack.dev.js b/webpack.dev.js index 7218276..b66fe1c 100644 --- a/webpack.dev.js +++ b/webpack.dev.js @@ -1,6 +1,14 @@ const HtmlWebpackPlugin = require('html-webpack-plugin') const webpack = require('webpack') +const XPOS_LABELS = ["CC", "CD", "DT", "EX", "FW", "HYPH", "IN", "IN/that", "JJ", "JJR", "JJS", "LS", "MD", "NN", +"NNS", "NP", "NPS", "PDT", "POS", "PP", "PP$", "RB", "RBR", "RBS", "RP", "SENT", "SYM", "TO", "UH", "VB", "VBD", "VBG", "VBN", "VBP", +"VBZ", "VH", "VHD", "VHG", "VHN", "VHP", "VHZ", "VV", "VVD", "VVG", "VVN", "VVP", "VVZ", "WDT", "WP", "WP$", "WRB", "``", "\'\'", "(", ")", ",", ":"] +.map(x => JSON.stringify(x)) +const DEPREL_LABELS = [ "nsubj", "obj", "iobj", "csubj", "ccomp", "xcomp", "obl", "vocative", "expl", "dislocated", +"advcl", "advmod", "discourse", "aux", "cop", "mark", "nmod", "appos", "nummod", "acl", "amod", "det", "clf", "case", +"conj", "cc", "fixed", "flat", "compound", "list", "parataxis", "orphan", "goeswith", "reparandum", "punct", "root", "dep"] +.map(x => JSON.stringify(x)) module.exports = { @@ -75,6 +83,8 @@ module.exports = { // The probability under which a label probability provided by an NLP service is viewed as // "suspicious" by the UI. Suspicious labels are graphically indicated as such in the UI. SUSPICIOUS_PROBABILITY_THRESHOLD: 0.9, + XPOS_LABELS: XPOS_LABELS, + DEPREL_LABELS: DEPREL_LABELS, }), new HtmlWebpackPlugin({ template: './src/page-document/tmpl.html', diff --git a/webpack.prod.js b/webpack.prod.js index 57f4314..9e16a68 100644 --- a/webpack.prod.js +++ b/webpack.prod.js @@ -8,6 +8,15 @@ const TerserPlugin = require('terser-webpack-plugin') const buildPath = path.resolve(__dirname, 'dist') +const XPOS_LABELS = ["CC", "CD", "DT", "EX", "FW", "HYPH", "IN", "IN/that", "JJ", "JJR", "JJS", "LS", "MD", "NN", +"NNS", "NP", "NPS", "PDT", "POS", "PP", "PP$", "RB", "RBR", "RBS", "RP", "SENT", "SYM", "TO", "UH", "VB", "VBD", "VBG", "VBN", "VBP", +"VBZ", "VH", "VHD", "VHG", "VHN", "VHP", "VHZ", "VV", "VVD", "VVG", "VVN", "VVP", "VVZ", "WDT", "WP", "WP$", "WRB", "``", "\'\'", "(", ")", ",", ":"] +.map(x => JSON.stringify(x)) +const DEPREL_LABELS = [ "nsubj", "obj", "iobj", "csubj", "ccomp", "xcomp", "obl", "vocative", "expl", "dislocated", +"advcl", "advmod", "discourse", "aux", "cop", "mark", "nmod", "appos", "nummod", "acl", "amod", "det", "clf", "case", +"conj", "cc", "fixed", "flat", "compound", "list", "parataxis", "orphan", "goeswith", "reparandum", "punct", "root", "dep"] +.map(x => JSON.stringify(x)) + module.exports = { // https://webpack.js.org/configuration/mode/ @@ -84,6 +93,8 @@ module.exports = { // The probability under which a label probability provided by an NLP service is viewed as // "suspicious" by the UI. Suspicious labels are graphically indicated as such in the UI. SUSPICIOUS_PROBABILITY_THRESHOLD: 0.9, + XPOS_LABELS: XPOS_LABELS, + DEPREL_LABELS: DEPREL_LABELS, }), new HtmlWebpackPlugin({ template: './src/page-document/tmpl.html',