summaryrefslogtreecommitdiff
path: root/packages/lang/test.ts
blob: d1763ca61a32e75122267fde25f80e3ce6125061 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { franc, francAll } from "franc-all";
import { getScriptPredictor } from "./src";

const a = "My name is John.";
const a2 = "My name is John";
const b = "ของไทย";
const b2 = "ของไทย";
const c = "こんにちは";
const c2 = "こんにちは";
//
// This isn't working must be using some browser APIs to do the work I guess
const fa = franc("My name is John.");
const fa2 = francAll("My name is John");
const fb = franc("ของไทย");
const fb2 = francAll("ของไทย");
const fc = franc("こんにちは");
const fc2 = franc("こんにちは");

console.log({ fa, fa2, fb, fb2, fc, fc2 });

const Predictor = getScriptPredictor();
const ua = Predictor(a);

console.dir({ ua }, { depth: null });