Skip to content

Commit 6fc8ea1

Browse files
committed
[Template merge] add pipeline.ts to analysers too
1 parent 98893ba commit 6fc8ea1

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tools/analysers/pipeline.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import * as cg3 from "./.divvun-rt/cg3.ts";
2+
import * as divvun from "./.divvun-rt/divvun.ts";
3+
import * as hfst from "./.divvun-rt/hfst.ts";
4+
import { Command, StringEntry } from "./.divvun-rt/mod.ts";
5+
6+
export default function smjAnalyser(entry: StringEntry): Command {
7+
let x = hfst.tokenize("tokenize", entry, { model_path: "tokeniser-disamb-gt-desc.pmhfst" });
8+
x = divvun.blanktag("whitespace", x, { model_path: "analyser-gt-whitespace.hfst" });
9+
x = cg3.vislcg3("mwe-dis", x, { model_path: "mwe-dis.bin" });
10+
x = cg3.mwesplit("mwesplit", x);
11+
x = cg3.vislcg3("disamb", x, { model_path: "disambiguator.bin" });
12+
x = cg3.vislcg3("functions", x, { model_path: "functions.bin" });
13+
return cg3.vislcg3("dependency", x, { model_path: "dependency.bin" });
14+
}
15+
16+
/**
17+
* Dev pipeline for testing with local models.
18+
*/
19+
export function localTest_dev(entry: StringEntry): Command {
20+
let x = hfst.tokenize("tokenize", entry, { model_path: "@./tokeniser-disamb-gt-desc.pmhfst" });
21+
x = divvun.blanktag("whitespace", x, { model_path: "@./analyser-gt-whitespace.hfst" });
22+
x = cg3.vislcg3("mwe-dis", x, { model_path: "@../tokenisers/mwe-dis.cg3" });
23+
x = cg3.mwesplit("mwesplit", x);
24+
x = cg3.vislcg3("disamb", x, { model_path: "@../../src/cg3/disambiguator.cg3" });
25+
x = cg3.vislcg3("functions", x, { model_path: "@../../../shared-smi/src/cg3/functions.cg3" });
26+
return cg3.vislcg3("dependency", x, { model_path: "@../../../shared-smi/src/cg3/dependency.cg3" });
27+
}

0 commit comments

Comments
 (0)