Skip to content

Commit

Permalink
Fix Web Demo Word Segmenter (#6099)
Browse files Browse the repository at this point in the history
Just updates the custom demo-gen function to use the new `WordSegmenter`
function names, as well as fixing some JSON to match what the rendering
JS is expecting.
  • Loading branch information
ambiguousname authored Feb 12, 2025
1 parent 16d1364 commit c074ba1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions ffi/capi/bindings/demo_gen/WordSegmenter.mjs

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

8 changes: 5 additions & 3 deletions ffi/npm/demo_gen_custom/WordSegmenter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ export default {
var segmenter;
switch (model) {
case "Auto":
segmenter = lib.WordSegmenter.createRootAuto();
segmenter = lib.WordSegmenter.createAuto();
break;
case "LSTM":
segmenter = lib.WordSegmenter.createRootLstm();
segmenter = lib.WordSegmenter.createLstm();
break;
case "Dictionary":
segmenter = lib.WordSegmenter.createRootDictionary();
segmenter = lib.WordSegmenter.createDictionary();
}

let last = 0;
Expand All @@ -39,11 +39,13 @@ export default {
{
name: "Model Type (Auto, LSTM, or Dictionary)",
type: "string",
typeUse: "string",
defaultValue: "Auto"
},
{
name: "Text",
type: "string",
typeUse: "string",
defaultValue: "โดยที่การยอมรับนับถือเกียรติศักดิ์ประจำตัว และสิทธิเท่าเทียมกันและโอนมิได้ของบรรดา สมาชิก ทั้ง หลายแห่งครอบครัว มนุษย์เป็นหลักมูลเหตุแห่งอิสรภาพ ความยุติธรรม และสันติภาพในโลก"
}
]
Expand Down

0 comments on commit c074ba1

Please sign in to comment.