forked from pulipulichen/jieba-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.20200508.html
271 lines (241 loc) · 10.9 KB
/
index.20200508.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<!DOCTYPE html>
<html>
<head>
<title>jieba-js demo</title>
<link rel="icon" type="image/png" href="icon.png" />
<link rel="stylesheet" href="html-lib/style.css" />
<script src="jquery.js"></script>
<script src="require-jieba-js.js"></script>
<link rel="stylesheet" href="html-lib/vendors/semantic-ui/semantic.min.css" />
<script src="html-lib/vendors/semantic-ui/semantic.min.js"></script>
<!-- <script src="html-lib/Garlic.js/garlic.js"></script> -->
<script src="html-lib/input-file-loader.js"></script>
<script src="html-lib/vendors/FileSaver.js"></script>
<script src="html-lib/vendors/clipboard/clipboard.min.js"></script>
<script src="html-lib/vendors/clipboard/puli-util.clipboard.js"></script>
<script src="html-lib/vendors/puli-post-message-api/puli-post-message-api.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<form onsubmit="return false;" class="ui form" id="app">
<div class="ui ordered fluid steps">
<div class="step"
v-bind:class="computedStepClass(0)"
v-on:click="step=0">
<div class="content">
<div class="title">Input Raw Text</div>
</div>
</div>
<div class="step"
v-bind:class="computedStepClass(1)"
v-on:click="step=1">
<div class="content">
<div class="title">Configuration</div>
</div>
</div>
<div class="step"
v-bind:class="computedStepClass(2)"
v-on:click="step=2">
<div class="content">
<div class="title">Output Segmentation Result</div>
</div>
</div>
</div>
<div class="ui grid container"
v-show="step === 0">
<div class="row">
<div class="ten wide column">
<label class="ui header">Raw Text</label>
</div>
<div class="six wide column" style="text-align:right; margin-bottom: 5px;">
<button class="ui mini icon basic button" onclick="$('#input_file').click();">
<i class="folder open outline icon"></i>
</button>
<input type="file" class="input-field"
id="input_file" load_content_to="#input" />
<button class="ui mini icon basic button" copy-from="#input">
<i class="copy icon"></i>
</button>
</div>
</div>
<div class="row">
<div class="sixteen wide column">
<!-- http://blog.fukuball.com/ru-he-shi-yong-jieba-jie-ba-zhong-wen-fen-ci-cheng-shi/ -->
<textarea name="input" id="input" class="ui raised fluid segment"
>這個布丁 是在無聊的世界中找尋樂趣的一種不能吃的食物,
喜愛動漫畫、遊戲、coding,以及跟世間脫節的生活步調。</textarea>
</div>
</div>
</div>
<div class="ui grid container"
v-show="step === 1">
STEP2
</div>
<div class="ui grid container"
v-show="step === 2">
STEP3
</div>
<div class="ui grid container">
<div class="eight wide column field">
<div class="ui grid">
<div class="ten wide column">
<label>Raw Text</label>
</div>
<div class="six wide column" style="text-align:right; margin-bottom: 5px;">
<button class="ui mini icon basic button" onclick="$('#input_file').click();">
<i class="upload icon"></i>
</button>
<input type="file" class="input-field"
id="input_file" load_content_to="#input" />
<button class="ui mini icon basic button" copy-from="#input">
<i class="copy icon"></i>
</button>
</div>
</div>
<!-- http://blog.fukuball.com/ru-he-shi-yong-jieba-jie-ba-zhong-wen-fen-ci-cheng-shi/ -->
<textarea name="input" id="input" class="ui raised segment"
>這個布丁 是在無聊的世界中找尋樂趣的一種不能吃的食物,
喜愛動漫畫、遊戲、程式coding,以及跟世間脫節的生活步調。</textarea>
</div> <!-- <div class="eight wide column"> -->
<div class="eight wide column field">
<div class="ui grid">
<div class="ten wide column">
<label>Processed Text</label>
</div>
<div class="six wide column" style="text-align:right; margin-bottom: 5px;">
<button class="ui mini icon basic button" onclick="_download_file('output');">
<i class="download icon"></i>
</button>
<button class="ui mini icon basic button" copy-from="#output">
<i class="copy icon"></i>
</button>
</div>
</div>
<textarea name="output" id="output" class="ui raised segment" data-storage="false"></textarea>
</div> <!-- <div class="eight wide column"> -->
<div class="sixteen wide column">
<div class="fields">
<div class="eight wide field">
<div class="fields">
<div class="inline input field">
<input type="radio" name="token_rule" value="dictionary" checked="checked">
<label>Dictionary</label>
</div>
<div class="inline input field">
<input type="radio" name="token_rule" value="n-gram">
<label>
<input type="number" value="2" class="n-gram-number" />
-gram
</label>
</div>
</div>
</div>
<div class="eight wide field">
<button type="submit" class="fluid primary ui button" id="trigger">開始斷詞</button>
</div> <!-- <div class="sixteen wide column field"> -->
</div>
</div>
<!--
<div class="eight wide column field">
<label>Segment Mode</label>
<select name="segment_mode" style="ui dropdown">
<option value="A">A</option>
<option value="B">B</option>
</select>
</div> <!-- <div class="sixteen wide column field"> -->
<div class="fields config">
<div class="field">
<div class="ui grid">
<div>
<label>Word Remap</label>
</div>
<div style="text-align:right; margin-bottom: 25px;">
<button class="ui mini basic button" onclick="_load_file('word_remap.txt', 'word_remap');">
<i class="file alternate outline icon"></i>
example
</button>
<button class="ui mini icon basic button" onclick="$('#word_remap').click();">
<i class="upload icon"></i>
</button>
<input type="file" class="input-field"
id="user_dict_file" load_content_to="#word_remap" />
<button class="ui mini icon basic button" onclick="_download_file('word_remap');">
<i class="download icon"></i>
</button>
<button class="ui mini icon basic button" copy-from="#word_remap">
<i class="copy icon"></i>
</button>
</div>
</div>
<div class="ui field">
<textarea name="word_remap" id="word_remap" class="data-auto-save">食物,甜點</textarea>
</div>
</div> <!-- <div class="eight wide column"> -->
<div class="field">
<div class="ui grid">
<div>
<label>User Dictionary</label>
</div>
<div style="text-align:right; margin-bottom: 25px;">
<button class="ui mini basic button" onclick="_load_file('user_dict.txt', 'user_dict');">
<i class="file alternate outline icon"></i>
example
</button>
<button class="ui mini icon basic button" onclick="$('#user_dict_file').click();">
<i class="upload icon"></i>
</button>
<input type="file" class="input-field"
id="user_dict_file" load_content_to="#user_dict" />
<button class="ui mini icon basic button" onclick="_download_file('user_dict');">
<i class="download icon"></i>
</button>
<button class="ui mini icon basic button" copy-from="#user_dict">
<i class="copy icon"></i>
</button>
</div>
</div>
<textarea name="user_dict" id="user_dict" class="data-auto-save">找尋樂趣,9999999,n
無聊的世界,9999999,n</textarea>
<!--
<textarea name="user_dict" id="user_dict"></textarea>
-->
</div> <!-- <div class="eight wide column"> -->
<div class="field">
<div class="ui grid">
<div>
<label>Stop Words</label>
</div>
<div style="text-align:right; margin-bottom: 25px;">
<button class="ui mini basic button" onclick="_load_file('stop_words.txt', 'stop_words');">
<i class="file alternate outline icon"></i>
example
</button>
<button class="ui mini icon basic button" onclick="$('#stop_words_file').click();">
<i class="upload icon"></i>
</button>
<input type="file" class="input-field"
id="stop_words_file" load_content_to="#stop_words" />
<button class="ui mini icon basic button" onclick="_download_file('stop_words');">
<i class="download icon"></i>
</button>
<button class="ui mini icon basic button" copy-from="#stop_words">
<i class="copy icon"></i>
</button>
</div>
</div>
<textarea name="stop_words" id="stop_words" class="data-auto-save">這個
,
、
。</textarea>
</div> <!-- <div class="eight wide column"> -->
</div>
</div> <!-- <div class="ui grid container"> -->
</form>
<!-- ========================================== -->
<script src="html-lib/script.js"></script>
<script src="html-lib/post-message.js"></script>
<script src="html-lib/form-persist.js"></script>
<script src="html-lib/vue-app.js"></script>
<script src="html-lib/ga.js"></script>
</body>
</html>