@@ -63,6 +63,7 @@ public boolean isAlive() {
6363 @ Override
6464 public native void close () throws Exception ;
6565 public native void _addTypo (String orig , String error , float cost , byte convVowel );
66+ public native void _setContinualTypoCost (float cost );
6667
6768 public TypoTransformer addTypo (String orig , String error , float cost , byte convVowel ) {
6869 _addTypo (orig , error , cost , convVowel );
@@ -77,6 +78,11 @@ public TypoTransformer addTypo(String[] orig, String[] error, float cost, byte c
7778 }
7879 return this ;
7980 }
81+
82+ public TypoTransformer setContinualTypoCost (float cost ) {
83+ _setContinualTypoCost (cost );
84+ return this ;
85+ }
8086 }
8187
8288 public KiwiBuilder (long _inst ) {
@@ -219,4 +225,121 @@ public Kiwi build(TypoTransformer typos) {
219225 .addTypo (new String []{"을" , "를" }, new String []{"을" , "를" }, 2.f , CondVowel .none )
220226
221227 .addTypo (new String []{"ㅣ워" , "ㅣ어" , "ㅕ" }, new String []{"ㅣ워" , "ㅣ어" , "ㅕ" }, 1.5f , CondVowel .none );
228+
229+ final public static TypoTransformer continualTypoSet = new TypoTransformer ()
230+ .setContinualTypoCost (1.f )
231+ .addTypo (new String []{"ᆪ" }, new String []{"ᆨᆺ" , "ᆨᆻ" }, 1e-12f , CondVowel .none )
232+ .addTypo (new String []{"ᆬ" }, new String []{"ᆫᆽ" }, 1e-12f , CondVowel .none )
233+ .addTypo (new String []{"ᆭ" }, new String []{"ᆫᇂ" }, 1e-12f , CondVowel .none )
234+ .addTypo (new String []{"ᆰ" }, new String []{"ᆯᆨ" }, 1e-12f , CondVowel .none )
235+ .addTypo (new String []{"ᆱ" }, new String []{"ᆯᆷ" }, 1e-12f , CondVowel .none )
236+ .addTypo (new String []{"ᆲ" }, new String []{"ᆯᆸ" }, 1e-12f , CondVowel .none )
237+ .addTypo (new String []{"ᆳ" }, new String []{"ᆯᆺ" }, 1e-12f , CondVowel .none )
238+ .addTypo (new String []{"ᆴ" }, new String []{"ᆯᇀ" }, 1e-12f , CondVowel .none )
239+ .addTypo (new String []{"ᆵ" }, new String []{"ᆯᇁ" }, 1e-12f , CondVowel .none )
240+ .addTypo (new String []{"ᆶ" }, new String []{"ᆯᇂ" }, 1e-12f , CondVowel .none )
241+ .addTypo (new String []{"ᆹ" }, new String []{"ᆸᆺ" , "ᆸᆻ" }, 1e-12f , CondVowel .none );
242+
243+ final public static TypoTransformer basicTypoSetWithContinual = new TypoTransformer ()
244+ .addTypo (new String []{"ㅐ" , "ㅔ" }, new String []{"ㅐ" , "ㅔ" }, 1.f , CondVowel .none )
245+ .addTypo (new String []{"ㅐ" , "ㅔ" }, new String []{"ㅒ" , "ㅖ" }, 1.5f , CondVowel .none )
246+ .addTypo (new String []{"ㅒ" , "ㅖ" }, new String []{"ㅐ" , "ㅔ" }, 1.5f , CondVowel .none )
247+ .addTypo (new String []{"ㅒ" , "ㅖ" }, new String []{"ㅒ" , "ㅖ" }, 1.f , CondVowel .none )
248+ .addTypo (new String []{"ㅚ" , "ㅙ" , "ㅞ" }, new String []{"ㅚ" , "ㅙ" , "ㅞ" , "ㅐ" , "ㅔ" }, 1.f , CondVowel .none )
249+ .addTypo (new String []{"ㅝ" }, new String []{"ㅗ" , "ㅓ" }, 1.f , CondVowel .none )
250+ .addTypo (new String []{"ㅟ" , "ㅢ" }, new String []{"ㅣ" }, 1.f , CondVowel .none )
251+ .addTypo (new String []{"위" , "의" }, new String []{"이" }, Float .POSITIVE_INFINITY , CondVowel .none )
252+ .addTypo (new String []{"위" , "의" }, new String []{"이" }, 1.f , CondVowel .any )
253+ .addTypo (new String []{"자" , "쟈" }, new String []{"자" , "쟈" }, 1.f , CondVowel .none )
254+ .addTypo (new String []{"재" , "쟤" }, new String []{"재" , "쟤" }, 1.f , CondVowel .none )
255+ .addTypo (new String []{"저" , "져" }, new String []{"저" , "져" }, 1.f , CondVowel .none )
256+ .addTypo (new String []{"제" , "졔" }, new String []{"제" , "졔" }, 1.f , CondVowel .none )
257+ .addTypo (new String []{"조" , "죠" , "줘" }, new String []{"조" , "죠" , "줘" }, 1.f , CondVowel .none )
258+ .addTypo (new String []{"주" , "쥬" }, new String []{"주" , "쥬" }, 1.f , CondVowel .none )
259+ .addTypo (new String []{"차" , "챠" }, new String []{"차" , "챠" }, 1.f , CondVowel .none )
260+ .addTypo (new String []{"채" , "챼" }, new String []{"채" , "챼" }, 1.f , CondVowel .none )
261+ .addTypo (new String []{"처" , "쳐" }, new String []{"처" , "쳐" }, 1.f , CondVowel .none )
262+ .addTypo (new String []{"체" , "쳬" }, new String []{"체" , "쳬" }, 1.f , CondVowel .none )
263+ .addTypo (new String []{"초" , "쵸" , "춰" }, new String []{"초" , "쵸" , "춰" }, 1.f , CondVowel .none )
264+ .addTypo (new String []{"추" , "츄" }, new String []{"추" , "츄" }, 1.f , CondVowel .none )
265+ .addTypo (new String []{"유" , "류" }, new String []{"유" , "류" }, 1.f , CondVowel .none )
266+ .addTypo (new String []{"므" , "무" }, new String []{"므" , "무" }, 1.f , CondVowel .none )
267+ .addTypo (new String []{"브" , "부" }, new String []{"브" , "부" }, 1.f , CondVowel .none )
268+ .addTypo (new String []{"프" , "푸" }, new String []{"프" , "푸" }, 1.f , CondVowel .none )
269+ .addTypo (new String []{"르" , "루" }, new String []{"르" , "루" }, 1.f , CondVowel .none )
270+ .addTypo (new String []{"러" , "뤄" }, new String []{"러" , "뤄" }, 1.f , CondVowel .none )
271+ .addTypo (new String []{"ᆩ" , "ᆪ" }, new String []{"ᆨ" , "ᆩ" , "ᆪ" }, 1.5f , CondVowel .none )
272+ .addTypo (new String []{"ᆬ" , "ᆭ" }, new String []{"ᆫ" , "ᆬ" , "ᆭ" }, 1.5f , CondVowel .none )
273+ .addTypo (new String []{"ᆰ" , "ᆱ" , "ᆲ" , "ᆳ" , "ᆴ" , "ᆵ" , "ᆶ" }, new String []{"ᆯ" , "ᆰ" , "ᆱ" , "ᆲ" , "ᆳ" , "ᆴ" , "ᆵ" , "ᆶ" }, 1.5f , CondVowel .none )
274+ .addTypo (new String []{"ᆺ" , "ᆻ" }, new String []{"ᆺ" , "ᆻ" }, 1.f , CondVowel .none )
275+
276+ .addTypo (new String []{"안" }, new String []{"않" }, 1.5f , CondVowel .none )
277+ .addTypo (new String []{"맞추" , "맞히" }, new String []{"맞추" , "맞히" }, 1.5f , CondVowel .none )
278+ .addTypo (new String []{"맞춰" , "맞혀" }, new String []{"맞춰" , "맞혀" }, 1.5f , CondVowel .none )
279+ .addTypo (new String []{"받치" , "바치" , "받히" }, new String []{"받치" , "바치" , "받히" }, 1.5f , CondVowel .none )
280+ .addTypo (new String []{"받쳐" , "바쳐" , "받혀" }, new String []{"받쳐" , "바쳐" , "받혀" }, 1.5f , CondVowel .none )
281+ .addTypo (new String []{"던" , "든" }, new String []{"던" , "든" }, 1.f , CondVowel .none )
282+ .addTypo (new String []{"때" , "데" }, new String []{"때" , "데" }, 1.5f , CondVowel .none )
283+ .addTypo (new String []{"빛" , "빚" }, new String []{"빛" , "빚" }, 1.f , CondVowel .none )
284+
285+ .addTypo (new String []{"ᆮ이" , "지" }, new String []{"ᆮ이" , "지" }, 1.f , CondVowel .none )
286+ .addTypo (new String []{"ᆮ여" , "져" }, new String []{"ᆮ여" , "져" }, 1.f , CondVowel .none )
287+ .addTypo (new String []{"ᇀ이" , "치" }, new String []{"ᇀ이" , "치" }, 1.f , CondVowel .none )
288+ .addTypo (new String []{"ᇀ여" , "쳐" }, new String []{"ᇀ여" , "쳐" }, 1.f , CondVowel .none )
289+
290+ .addTypo (new String []{"ᄀ" , "ᄁ" }, new String []{"ᄀ" , "ᄁ" }, 1.f , CondVowel .applosive )
291+ .addTypo (new String []{"ᄃ" , "ᄄ" }, new String []{"ᄃ" , "ᄄ" }, 1.f , CondVowel .applosive )
292+ .addTypo (new String []{"ᄇ" , "ᄈ" }, new String []{"ᄇ" , "ᄈ" }, 1.f , CondVowel .applosive )
293+ .addTypo (new String []{"ᄉ" , "ᄊ" }, new String []{"ᄉ" , "ᄊ" }, 1.f , CondVowel .applosive )
294+ .addTypo (new String []{"ᄌ" , "ᄍ" }, new String []{"ᄌ" , "ᄍ" }, 1.f , CondVowel .applosive )
295+
296+ .addTypo (new String []{"ᇂᄒ" , "ᆨᄒ" , "ᇂᄀ" }, new String []{"ᇂᄒ" , "ᆨᄒ" , "ᇂᄀ" }, 1.f , CondVowel .none )
297+
298+ .addTypo (new String []{"ᆨᄂ" , "ᆩᄂ" , "ᆪᄂ" , "ᆿᄂ" , "ᆼᄂ" }, new String []{"ᆨᄂ" , "ᆩᄂ" , "ᆪᄂ" , "ᆿᄂ" , "ᆼᄂ" }, 1.f , CondVowel .none )
299+ .addTypo (new String []{"ᆨᄆ" , "ᆩᄆ" , "ᆪᄆ" , "ᆿᄆ" , "ᆼᄆ" }, new String []{"ᆨᄆ" , "ᆩᄆ" , "ᆪᄆ" , "ᆿᄆ" , "ᆼᄆ" }, 1.f , CondVowel .none )
300+ .addTypo (new String []{"ᆨᄅ" , "ᆩᄅ" , "ᆪᄅ" , "ᆿᄅ" , "ᆼᄅ" , "ᆼᄂ" ,}, new String []{"ᆨᄅ" , "ᆩᄅ" , "ᆪᄅ" , "ᆿᄅ" , "ᆼᄅ" , "ᆼᄂ" ,}, 1.f , CondVowel .none )
301+ .addTypo (new String []{"ᆮᄂ" , "ᆺᄂ" , "ᆻᄂ" , "ᆽᄂ" , "ᆾᄂ" , "ᇀᄂ" , "ᆫᄂ" }, new String []{"ᆮᄂ" , "ᆺᄂ" , "ᆻᄂ" , "ᆽᄂ" , "ᆾᄂ" , "ᇀᄂ" , "ᆫᄂ" }, 1.f , CondVowel .none )
302+ .addTypo (new String []{"ᆮᄆ" , "ᆺᄆ" , "ᆻᄆ" , "ᆽᄆ" , "ᆾᄆ" , "ᇀᄆ" , "ᆫᄆ" }, new String []{"ᆮᄆ" , "ᆺᄆ" , "ᆻᄆ" , "ᆽᄆ" , "ᆾᄆ" , "ᇀᄆ" , "ᆫᄆ" }, 1.f , CondVowel .none )
303+ .addTypo (new String []{"ᆮᄅ" , "ᆺᄅ" , "ᆻᄅ" , "ᆽᄅ" , "ᆾᄅ" , "ᇀᄅ" , "ᆫᄅ" , "ᆫᄂ" ,}, new String []{"ᆮᄅ" , "ᆺᄅ" , "ᆻᄅ" , "ᆽᄅ" , "ᆾᄅ" , "ᇀᄅ" , "ᆫᄅ" , "ᆫᄂ" ,}, 1.f , CondVowel .none )
304+ .addTypo (new String []{"ᆸᄂ" , "ᆹᄂ" , "ᇁᄂ" , "ᆷᄂ" }, new String []{"ᆸᄂ" , "ᆹᄂ" , "ᇁᄂ" , "ᆷᄂ" }, 1.f , CondVowel .none )
305+ .addTypo (new String []{"ᆸᄆ" , "ᆹᄆ" , "ᇁᄆ" , "ᆷᄆ" }, new String []{"ᆸᄆ" , "ᆹᄆ" , "ᇁᄆ" , "ᆷᄆ" }, 1.f , CondVowel .none )
306+ .addTypo (new String []{"ᆸᄅ" , "ᆹᄅ" , "ᇁᄅ" , "ᆷᄅ" , "ᆷᄂ" ,}, new String []{"ᆸᄅ" , "ᆹᄅ" , "ᇁᄅ" , "ᆷᄅ" , "ᆷᄂ" ,}, 1.f , CondVowel .none )
307+ .addTypo (new String []{"ᆫᄅ" , "ᆫᄂ" , "ᆯᄅ" , "ᆯᄂ" }, new String []{"ᆫᄅ" , "ᆫᄂ" , "ᆯᄅ" , "ᆯᄂ" }, 1.f , CondVowel .none )
308+
309+ .addTypo (new String []{"ᆨᄋ" , "ᄀ" }, new String []{"ᆨᄋ" , "ᄀ" }, 1.f , CondVowel .vowel )
310+ .addTypo (new String []{"ᆩᄋ" , "ᄁ" }, new String []{"ᆩᄋ" , "ᄁ" }, 1.f , CondVowel .vowel )
311+ .addTypo (new String []{"ᆫᄋ" , "ᆫᄒ" , "ᄂ" }, new String []{"ᆫᄋ" , "ᆫᄒ" , "ᄂ" }, 1.f , CondVowel .vowel )
312+ .addTypo (new String []{"ᆬᄋ" , "ᆫᄌ" }, new String []{"ᆬᄋ" , "ᆫᄌ" }, 1.f , CondVowel .vowel )
313+ .addTypo (new String []{"ᆭᄋ" , "ᄂ" }, new String []{"ᆭᄋ" , "ᄂ" }, 1.f , CondVowel .vowel )
314+ .addTypo (new String []{"ᆮᄋ" , "ᄃ" }, new String []{"ᆮᄋ" , "ᄃ" }, 1.f , CondVowel .vowel )
315+ .addTypo (new String []{"ᆯᄋ" , "ᆯᄒ" , "ᄅ" }, new String []{"ᆯᄋ" , "ᆯᄒ" , "ᄅ" }, 1.f , CondVowel .vowel )
316+ .addTypo (new String []{"ᆰᄋ" , "ᆯᄀ" }, new String []{"ᆰᄋ" , "ᆯᄀ" }, 1.f , CondVowel .vowel )
317+ .addTypo (new String []{"ᆰᄒ" , "ᆯᄏ" }, new String []{"ᆰᄒ" , "ᆯᄏ" }, 1.f , CondVowel .vowel )
318+ .addTypo (new String []{"ᆷᄋ" , "ᄆ" }, new String []{"ᆷᄋ" , "ᄆ" }, 1.f , CondVowel .vowel )
319+ .addTypo (new String []{"ᆸᄋ" , "ᄇ" }, new String []{"ᆸᄋ" , "ᄇ" }, 1.f , CondVowel .vowel )
320+ .addTypo (new String []{"ᆺᄋ" , "ᄉ" }, new String []{"ᆺᄋ" , "ᄉ" }, 1.f , CondVowel .vowel )
321+ .addTypo (new String []{"ᆻᄋ" , "ᆺᄉ" , "ᄊ" }, new String []{"ᆻᄋ" , "ᆺᄉ" , "ᄊ" }, 1.f , CondVowel .vowel )
322+ .addTypo (new String []{"ᆽᄋ" , "ᄌ" }, new String []{"ᆽᄋ" , "ᄌ" }, 1.f , CondVowel .vowel )
323+ .addTypo (new String []{"ᆾᄋ" , "ᆾᄒ" , "ᆽᄒ" , "ᄎ" }, new String []{"ᆾᄋ" , "ᆾᄒ" , "ᆽᄒ" , "ᄎ" }, 1.f , CondVowel .vowel )
324+ .addTypo (new String []{"ᆿᄋ" , "ᆿᄒ" , "ᆨᄒ" , "ᄏ" }, new String []{"ᆿᄋ" , "ᆿᄒ" , "ᆨᄒ" , "ᄏ" }, 1.f , CondVowel .vowel )
325+ .addTypo (new String []{"ᇀᄋ" , "ᇀᄒ" , "ᆮᄒ" , "ᄐ" }, new String []{"ᇀᄋ" , "ᇀᄒ" , "ᆮᄒ" , "ᄐ" }, 1.f , CondVowel .vowel )
326+ .addTypo (new String []{"ᇁᄋ" , "ᇁᄒ" , "ᆸᄒ" , "ᄑ" }, new String []{"ᇁᄋ" , "ᇁᄒ" , "ᆸᄒ" , "ᄑ" }, 1.f , CondVowel .vowel )
327+
328+ .addTypo (new String []{"은" , "는" }, new String []{"은" , "는" }, 2.f , CondVowel .none )
329+ .addTypo (new String []{"을" , "를" }, new String []{"을" , "를" }, 2.f , CondVowel .none )
330+
331+ .addTypo (new String []{"ㅣ워" , "ㅣ어" , "ㅕ" }, new String []{"ㅣ워" , "ㅣ어" , "ㅕ" }, 1.5f , CondVowel .none )
332+ .setContinualTypoCost (1.f )
333+ .addTypo (new String []{"ᆪ" }, new String []{"ᆨᆺ" , "ᆨᆻ" }, 1e-12f , CondVowel .none )
334+ .addTypo (new String []{"ᆬ" }, new String []{"ᆫᆽ" }, 1e-12f , CondVowel .none )
335+ .addTypo (new String []{"ᆭ" }, new String []{"ᆫᇂ" }, 1e-12f , CondVowel .none )
336+ .addTypo (new String []{"ᆰ" }, new String []{"ᆯᆨ" }, 1e-12f , CondVowel .none )
337+ .addTypo (new String []{"ᆱ" }, new String []{"ᆯᆷ" }, 1e-12f , CondVowel .none )
338+ .addTypo (new String []{"ᆲ" }, new String []{"ᆯᆸ" }, 1e-12f , CondVowel .none )
339+ .addTypo (new String []{"ᆳ" }, new String []{"ᆯᆺ" }, 1e-12f , CondVowel .none )
340+ .addTypo (new String []{"ᆴ" }, new String []{"ᆯᇀ" }, 1e-12f , CondVowel .none )
341+ .addTypo (new String []{"ᆵ" }, new String []{"ᆯᇁ" }, 1e-12f , CondVowel .none )
342+ .addTypo (new String []{"ᆶ" }, new String []{"ᆯᇂ" }, 1e-12f , CondVowel .none )
343+ .addTypo (new String []{"ᆹ" }, new String []{"ᆸᆺ" , "ᆸᆻ" }, 1e-12f , CondVowel .none );
344+
222345}
0 commit comments