Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1130 lines
40 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (C) 1997, Microsoft Corporation. All Rights Reserved.
  4. //
  5. /////////////////////////////////////////////////////////////////////////////
  6. #include "basecik.hpp"
  7. #include "MainDict.h"
  8. //----------------------------------------------------------------------------------------------
  9. //
  10. // Function Name : NLP_Cikha_Proc()
  11. // Parameters : char *stem
  12. // Summary :
  13. // Call Functions :
  14. // Description :
  15. // Return Value :
  16. //
  17. //----------------------------------------------------------------------------------------------
  18. int BaseEngine::NLP_Cikha_Proc(char *stem)
  19. {
  20. char r_vowel,
  21. tmpstem[80],
  22. tmpending[10];
  23. int len, ix, res, ulspos, temp;
  24. lstrcpy(tmpstem, stem);
  25. ulspos = lstrlen(tmpstem)-1;
  26. if(__IsDefStem(ulspos, 5) == 1 &&
  27. tmpstem[ulspos-5] == __K_M && tmpstem[ulspos-4] == __K_J &&
  28. tmpstem[ulspos-3] == __V_l && tmpstem[ulspos-2] == __K_G &&
  29. tmpstem[ulspos-1] == __K_H && tmpstem[ulspos] == __V_k)
  30. {
  31. temp = ulspos;
  32. __DelStemN(tmpstem, &temp, 6);
  33. ulspos = temp;
  34. if(((len = NLP_Cikha_Conditions(tmpstem, TempCikha[0])) != INVALID) ||
  35. ((len = NLP_Cikha_Conditions(tmpstem, TempCikha[1])) != INVALID))
  36. {
  37. r_vowel = UDEF; // undefined
  38. for(ix = ulspos - len ; ix >= 0; ix--)
  39. {
  40. if (tmpstem[ix] >= __V_k)
  41. {
  42. r_vowel = tmpstem[ix];
  43. break;
  44. }
  45. }
  46. if (r_vowel == __V_k || r_vowel == __V_h || r_vowel == __V_i)
  47. {
  48. temp = ulspos;
  49. __DelStemN(tmpstem, &temp, len);
  50. ulspos = temp;
  51. if((res = NLP_AUX_Find(tmpstem, 0)) < INVALID)
  52. {
  53. return Cikha_VALID;
  54. }
  55. switch(tmpstem[ulspos])
  56. {
  57. case __K_B:
  58. if(FindIrrWord(tmpstem, _IV_BP) & FINAL)
  59. {
  60. return INVALID;
  61. }
  62. break;
  63. case __K_S:
  64. if(FindIrrWord(tmpstem, _IV_SP) & FINAL)
  65. {
  66. return INVALID;
  67. }
  68. break;
  69. case __K_D:
  70. if(FindIrrWord(tmpstem, _IV_DP) & FINAL)
  71. {
  72. if(FindIrrWord(tmpstem, _RV_D) & FINAL) // v2r
  73. {
  74. char tstem [80];
  75. Conv.INS2HAN (tmpstem, tstem, codeWanSeong);
  76. lstrcat (lrgsz, tstem);
  77. vbuf [wcount++] = POS_VERB;
  78. return Cikha_VALID;
  79. }
  80. return INVALID;
  81. }
  82. break;
  83. case __K_R:
  84. __RepStem1(tmpstem, ulspos, __K_D);
  85. if(FindIrrWord(tmpstem, _IV_DP) & FINAL)
  86. {
  87. char tstem [80];
  88. Conv.INS2HAN (tmpstem, tstem, codeWanSeong);
  89. lstrcat (lrgsz, tstem);
  90. vbuf [wcount++] = POS_VERB;
  91. return Cikha_VALID;
  92. }
  93. __RepStem1(tmpstem, ulspos, __K_R);
  94. break;
  95. }
  96. if(tmpstem[ulspos] >= __V_k)
  97. {
  98. temp = ulspos;
  99. __AddStem1(tmpstem, &temp, __K_S);
  100. ulspos = temp;
  101. if(FindIrrWord(tmpstem, _IV_SP) & FINAL)
  102. {
  103. char tstem [80];
  104. Conv.INS2HAN (tmpstem, tstem, codeWanSeong);
  105. lstrcat (lrgsz, tstem);
  106. vbuf [wcount++] = POS_ADJECTIVE;
  107. return Cikha_VALID;
  108. }
  109. __RepStem1(tmpstem, ulspos, __K_I);
  110. temp = ulspos;
  111. __AddStem1(tmpstem, &temp, __V_m);
  112. ulspos = temp;
  113. if(FindIrrWord(tmpstem, _IV_OmP) & FINAL)
  114. {
  115. char tstem [80];
  116. Conv.INS2HAN (tmpstem, tstem, codeWanSeong);
  117. lstrcat (lrgsz, tstem);
  118. vbuf [wcount++] = POS_ADJECTIVE;
  119. return Cikha_VALID;
  120. }
  121. temp = ulspos;
  122. __DelStem2(tmpstem, &temp);
  123. ulspos = temp;
  124. if(tmpstem[ulspos] == __V_k)
  125. {
  126. return MORECHECK;
  127. }
  128. }
  129. char tstem [80];
  130. Conv.INS2HAN (tmpstem, tstem, codeWanSeong);
  131. if (FindSilsaWord (tstem) & _VERB)
  132. {
  133. lstrcat (lrgsz, tstem);
  134. vbuf [wcount++] = POS_VERB;
  135. return Cikha_VALID;
  136. }
  137. }
  138. }
  139. lstrcpy(tmpstem, stem);
  140. ulspos = lstrlen(tmpstem)-1;
  141. temp = ulspos;
  142. __DelStemN(tmpstem, &temp, 6);
  143. ulspos = temp;
  144. if(((len = NLP_Cikha_Conditions(tmpstem, TempCikha[2])) != INVALID) ||
  145. ((len = NLP_Cikha_Conditions(tmpstem, TempCikha[3])) != INVALID))
  146. {
  147. r_vowel = UDEF; // undefined
  148. for(ix = ulspos - len ; ix >= 0; ix--)
  149. {
  150. if (tmpstem[ix] >= __V_k)
  151. {
  152. r_vowel = tmpstem[ix];
  153. break;
  154. }
  155. }
  156. if (r_vowel != __V_k && r_vowel != __V_h && r_vowel != __V_i)
  157. {
  158. temp = ulspos;
  159. __DelStemN(tmpstem, &temp, len);
  160. ulspos = temp;
  161. if((res = NLP_AUX_Find(tmpstem, 0)) < INVALID)
  162. {
  163. return Cikha_VALID;
  164. }
  165. switch(tmpstem[ulspos])
  166. {
  167. case __K_B:
  168. if(FindIrrWord(tmpstem, _IV_BM) & FINAL)
  169. {
  170. return INVALID;
  171. }
  172. break;
  173. case __K_S:
  174. if(FindIrrWord(tmpstem, _IV_SM) & FINAL)
  175. {
  176. return INVALID;
  177. }
  178. break;
  179. case __K_D:
  180. if(FindIrrWord(tmpstem, _IV_DM) & FINAL)
  181. {
  182. if(FindIrrWord(tmpstem, _RV_D) & FINAL) // v2r
  183. {
  184. char tstem [80];
  185. Conv.INS2HAN (tmpstem, tstem, codeWanSeong);
  186. lstrcat (lrgsz, tstem);
  187. vbuf [wcount++] = POS_VERB;
  188. return Cikha_VALID;
  189. }
  190. return INVALID;
  191. }
  192. break;
  193. case __K_R:
  194. __RepStem1(tmpstem, ulspos, __K_D);
  195. if(FindIrrWord(tmpstem, _IV_DM) & FINAL)
  196. {
  197. char tstem [80];
  198. Conv.INS2HAN (tmpstem, tstem, codeWanSeong);
  199. lstrcat (lrgsz, tstem);
  200. vbuf [wcount++] = POS_VERB;
  201. return Cikha_VALID;
  202. }
  203. __RepStem1(tmpstem, ulspos, __K_R);
  204. break;
  205. }
  206. if(tmpstem[ulspos] >= __V_k)
  207. {
  208. temp = ulspos;
  209. __AddStem1(tmpstem, &temp, __K_S);
  210. ulspos = temp;
  211. if(FindIrrWord(tmpstem, _IV_SM) & FINAL)
  212. {
  213. char tstem [80];
  214. Conv.INS2HAN (tmpstem, tstem, codeWanSeong);
  215. lstrcat (lrgsz, tstem);
  216. vbuf [wcount++] = POS_VERB;
  217. return Cikha_VALID;
  218. }
  219. temp = ulspos;
  220. __DelStem1(tmpstem, &temp);
  221. ulspos = temp;
  222. if(tmpstem[ulspos] == __V_j)
  223. {
  224. return MORECHECK;
  225. }
  226. }
  227. char tstem [80];
  228. Conv.INS2HAN (tmpstem, tstem, codeWanSeong);
  229. if (FindSilsaWord (tstem) & _VERB)
  230. {
  231. lstrcat (lrgsz, tstem);
  232. vbuf [wcount++] = POS_VERB;
  233. return Cikha_VALID;
  234. }
  235. }
  236. }
  237. lstrcpy(tmpstem, stem);
  238. ulspos = lstrlen(tmpstem)-1;
  239. temp = ulspos;
  240. __DelStemN(tmpstem, &temp, 6);
  241. ulspos = temp;
  242. if(((len = NLP_Cikha_Conditions(tmpstem, TempCikha[4])) != INVALID) ||
  243. ((len = NLP_Cikha_Conditions(tmpstem, TempCikha[5])) != INVALID))
  244. {
  245. if(tmpstem[ulspos-len] >= __V_k)
  246. {
  247. temp = ulspos;
  248. __DelStemN(tmpstem, &temp, len);
  249. ulspos = temp;
  250. if(len == 6)
  251. {
  252. lstrcpy(tmpending, TempCikha[4]);
  253. }
  254. else
  255. {
  256. lstrcpy(tmpending, TempCikha[5]);
  257. }
  258. _strrev(tmpending);
  259. if((res = NLP_Cikha_SS(tmpstem, tmpending)) < INVALID)
  260. {
  261. return Cikha_VALID;
  262. }
  263. return res;
  264. }
  265. }
  266. if((len = NLP_Cikha_Conditions(tmpstem, TempCikha[6])) != INVALID)
  267. {
  268. if(tmpstem[ulspos-len] <= __K_H)
  269. {
  270. temp = ulspos;
  271. __DelStemN(tmpstem, &temp, len);
  272. ulspos = temp;
  273. if((res = NLP_AUX_Find(tmpstem, 0)) < INVALID)
  274. {
  275. return Cikha_VALID;
  276. }
  277. switch(tmpstem[ulspos])
  278. {
  279. case __K_B:
  280. if((FindIrrWord(tmpstem, _IV_BP) & FINAL) ||
  281. (FindIrrWord(tmpstem, _IV_BM) & FINAL))
  282. {
  283. return INVALID;
  284. }
  285. break;
  286. case __K_S:
  287. if((FindIrrWord(tmpstem, _IV_SP) & FINAL) ||
  288. (FindIrrWord(tmpstem, _IV_SM) & FINAL))
  289. {
  290. return INVALID;
  291. }
  292. break;
  293. case __K_D:
  294. if((FindIrrWord(tmpstem, _IV_DP) & FINAL) ||
  295. (FindIrrWord(tmpstem, _IV_DM) & FINAL))
  296. {
  297. if(FindIrrWord(tmpstem, _RV_D) & FINAL) // v2r
  298. {
  299. char tstem [80];
  300. Conv.INS2HAN (tmpstem, tstem, codeWanSeong);
  301. lstrcat (lrgsz, tstem);
  302. vbuf [wcount++] = POS_VERB;
  303. return Cikha_VALID;
  304. }
  305. return INVALID;
  306. }
  307. break;
  308. }
  309. char tstem [80];
  310. Conv.INS2HAN (tmpstem, tstem, codeWanSeong);
  311. if (FindSilsaWord (tstem) & _VERB)
  312. {
  313. lstrcat (lrgsz, tstem);
  314. vbuf [wcount++] = POS_VERB;
  315. return Cikha_VALID;
  316. }
  317. temp = ulspos;
  318. __AddStem2(tmpstem, &temp, __K_I, __V_m);
  319. ulspos = temp;
  320. }
  321. }
  322. if(tmpstem[ulspos] >= __V_k)
  323. {
  324. if((res = NLP_AUX_Find(tmpstem, 0)) < INVALID)
  325. {
  326. return Cikha_VALID;
  327. }
  328. char tstem [80];
  329. Conv.INS2HAN (tmpstem, tstem, codeWanSeong);
  330. if (FindSilsaWord (tstem) & _VERB)
  331. {
  332. lstrcat (lrgsz, tstem);
  333. vbuf [wcount++] = POS_VERB;
  334. return Cikha_VALID;
  335. }
  336. if(__IsDefStem(ulspos, 1) == 1 && tmpstem[ulspos-1] == __K_I && tmpstem[ulspos] == __V_m)
  337. {
  338. temp = ulspos;
  339. __DelStem2(tmpstem, &temp);
  340. ulspos = temp;
  341. if(tmpstem[ulspos] == __K_R)
  342. {
  343. __RepStem1(tmpstem, ulspos, __K_D);
  344. if((FindIrrWord(tmpstem, _IV_DP) & FINAL) || // v2+
  345. (FindIrrWord(tmpstem, _IV_DM) & FINAL)) // v2-
  346. {
  347. char tstem [80];
  348. Conv.INS2HAN (tmpstem, tstem, codeWanSeong);
  349. lstrcat (lrgsz, tstem);
  350. vbuf [wcount++] = POS_VERB;
  351. return Cikha_VALID;
  352. }
  353. return INVALID;
  354. }
  355. if(tmpstem[ulspos] >= __V_k)
  356. {
  357. temp = ulspos;
  358. __AddStem1(tmpstem, &temp, __K_S);
  359. ulspos = temp;
  360. if((FindIrrWord(tmpstem, _IV_SP) & FINAL) || // v4+
  361. (FindIrrWord(tmpstem, _IV_SM) & FINAL)) // v4-
  362. {
  363. char tstem [80];
  364. Conv.INS2HAN (tmpstem, tstem, codeWanSeong);
  365. lstrcat (lrgsz, tstem);
  366. vbuf [wcount++] = POS_VERB;
  367. return Cikha_VALID;
  368. }
  369. return INVALID;
  370. }
  371. }
  372. else if(__IsDefStem(ulspos, 1) == 1 && tmpstem[ulspos-1] == __K_I && tmpstem[ulspos] == __V_n)
  373. {
  374. temp = ulspos;
  375. __DelStem1(tmpstem, &temp);
  376. ulspos = temp;
  377. __RepStem1(tmpstem, ulspos, __K_B);
  378. if(FindIrrWord(tmpstem, _IV_BM) & FINAL) // v3-
  379. {
  380. char tstem [80];
  381. Conv.INS2HAN (tmpstem, tstem, codeWanSeong);
  382. lstrcat (lrgsz, tstem);
  383. vbuf [wcount++] = POS_VERB;
  384. return Cikha_VALID;
  385. }
  386. if(__IsDefStem(ulspos, 2) == 1 && __IsDefStem(ulspos, 3) == 0 &&
  387. tmpstem[ulspos-2] == __K_D && tmpstem[ulspos-1] == __V_h && tmpstem[ulspos] == __K_B)
  388. {
  389. char tstem [80];
  390. Conv.INS2HAN (tmpstem, tstem, codeWanSeong);
  391. lstrcat (lrgsz, tstem);
  392. vbuf [wcount++] = POS_VERB;
  393. return Cikha_VALID;
  394. }
  395. }
  396. else if(__IsDefStem(ulspos, 1) == 1 && tmpstem[ulspos-1] == __K_I && tmpstem[ulspos] == __V_h)
  397. {
  398. temp = ulspos;
  399. __DelStem1(tmpstem, &temp);
  400. ulspos = temp;
  401. __RepStem1(tmpstem, ulspos, __K_B);
  402. if(__IsDefStem(ulspos, 2) == 1 && __IsDefStem(ulspos, 3) == 0 &&
  403. tmpstem[ulspos-2] == __K_D && tmpstem[ulspos-1] == __V_h && tmpstem[ulspos] == __K_B)
  404. {
  405. return INVALID;
  406. }
  407. if(FindIrrWord(tmpstem, _IV_BP) & FINAL) // v3+
  408. {
  409. char tstem [80];
  410. Conv.INS2HAN (tmpstem, tstem, codeWanSeong);
  411. lstrcat (lrgsz, tstem);
  412. vbuf [wcount++] = POS_VERB;
  413. return Cikha_VALID;
  414. }
  415. }
  416. return BT;
  417. }
  418. }
  419. return MORECHECK;
  420. }
  421. //----------------------------------------------------------------------------------------------
  422. //
  423. // Function Name : NLP_Cikha_Conditions()
  424. // Parameters : char *stem
  425. // char *conditions
  426. // Summary :
  427. // Call Functions :
  428. // Description :
  429. // Return Value :
  430. //
  431. //----------------------------------------------------------------------------------------------
  432. int BaseEngine::NLP_Cikha_Conditions(char *stem, char *condition)
  433. {
  434. int i_stem = lstrlen(stem) - 1;
  435. int i_condition = lstrlen(condition) - 1;
  436. for( ; i_condition >= 0 && i_stem >= 0 ; )
  437. {
  438. if(stem[i_stem] != condition[i_condition])
  439. {
  440. return INVALID;
  441. }
  442. i_stem--;
  443. i_condition--;
  444. }
  445. if(i_condition = -1 && i_stem >= 0)
  446. {
  447. return lstrlen(condition);
  448. }
  449. return INVALID;
  450. }
  451. //----------------------------------------------------------------------------------------------
  452. //
  453. // Function Name : NLP_Cikha_SS()
  454. // Parameters : char *stem
  455. // char *conditions
  456. // Summary :
  457. // Call Functions :
  458. // Description :
  459. // Return Value :
  460. //
  461. //----------------------------------------------------------------------------------------------
  462. int BaseEngine::NLP_Cikha_SS(char *stem, char *ending)
  463. {
  464. char tmp[80];
  465. int ret, rULSPOS, temp;
  466. rULSPOS = lstrlen(stem)-1;
  467. lstrcpy(tmp, stem);
  468. ret = MORECHECK;
  469. switch (stem[rULSPOS])
  470. {
  471. case __V_l :
  472. ret = NLP_Cikha_SS_Vl(stem, ending);
  473. break;
  474. case __V_u :
  475. if (__IsDefStem(rULSPOS, 1) == 1 && stem[rULSPOS-1] == __K_I)
  476. {
  477. ret = NLP_Cikha_SS_Vu_mrg(stem, ending);
  478. if (ret == Machine_T)
  479. {
  480. temp = rULSPOS;
  481. __DelStem2(tmp, &temp);
  482. rULSPOS = temp;
  483. if ((ret = NLP_Machine_T(tmp, ending)) == MORECHECK)
  484. {
  485. ret = BT;
  486. }
  487. }
  488. break;
  489. }
  490. else
  491. {
  492. ret = NLP_Cikha_SS_Vu_irr(stem, ending);
  493. }
  494. break;
  495. case __V_nj :
  496. ret = NLP_Cikha_SS_Vnj(stem, ending);
  497. break;
  498. case __V_hk :
  499. ret = NLP_Cikha_SS_Vhk(stem, ending);
  500. break;
  501. case __V_ho :
  502. ret = NLP_Cikha_SS_Vho(stem, ending);
  503. break;
  504. case __V_o :
  505. if (__IsDefStem(rULSPOS, 1) == 1 && stem[rULSPOS-1] == __K_H)
  506. {
  507. ret = NLP_Cikha_SS_Vo_KH(stem, ending);
  508. }
  509. else
  510. {
  511. ret = NLP_Cikha_SS_Vo(stem, ending);
  512. }
  513. break;
  514. case __V_p :
  515. ret = NLP_Cikha_SS_Vp(stem);
  516. break;
  517. case __V_j :
  518. if (__IsDefStem(rULSPOS, 1) == 1 && stem[rULSPOS-1] == __K_R)
  519. ret = NLP_Cikha_SS_Vj_KR(stem);
  520. else ret = NLP_Cikha_SS_Vj(stem);
  521. break;
  522. case __V_k :
  523. ret = NLP_Cikha_SS_Vk(stem, ending);
  524. break;
  525. default : ret = BT;
  526. }
  527. return ret;
  528. }
  529. // ----------------------------------------------------------------------
  530. //
  531. //
  532. // ----------------------------------------------------------------------
  533. int BaseEngine::NLP_Cikha_SS_Vl(char *stem,
  534. char *ending)
  535. {
  536. char bupstem[80];
  537. int res, rULSPOS, rLMEPOS, temp;
  538. lstrcpy(bupstem, stem);
  539. rULSPOS = lstrlen(stem)-1;
  540. rLMEPOS = lstrlen(ending)-1;
  541. if (__IsDefStem(rULSPOS, 1) == 1 && bupstem[rULSPOS-1] == __K_I )
  542. {
  543. if (__IsDefEnd(rLMEPOS, 0) == 1 && ending[rLMEPOS] == __K_S_D)
  544. {
  545. temp = rULSPOS;
  546. __AddStem1(bupstem, &temp, __K_S_D);
  547. rULSPOS = temp;
  548. if((res = NLP_AUX_Find(bupstem, 0)) < INVALID)
  549. {
  550. return res;
  551. }
  552. if((res = NLP_AUX_Find(bupstem, 1)) < INVALID)
  553. {
  554. return res;
  555. }
  556. if (FindIrrWord(bupstem, _ISS) & FINAL)
  557. {
  558. char tstem [80];
  559. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  560. lstrcat (lrgsz, tstem);
  561. vbuf [wcount++] = POS_VERB;
  562. return Cikha_VALID;
  563. }
  564. }
  565. return INVALID;
  566. }
  567. return BT;
  568. }
  569. // ----------------------------------------------------------------------
  570. //
  571. //
  572. // ----------------------------------------------------------------------
  573. int BaseEngine::NLP_Cikha_SS_Vu_mrg(char *stem,
  574. char *ending)
  575. {
  576. char bupstem[80];
  577. int res, rULSPOS, temp;
  578. rULSPOS = lstrlen(stem)-1;
  579. lstrcpy(bupstem, stem);
  580. if (__IsDefStem(rULSPOS, 3) == 1 &&
  581. bupstem[rULSPOS-3] == __K_H && bupstem[rULSPOS-2] == __V_k )
  582. {
  583. temp = rULSPOS;
  584. __DelStem2(bupstem, &temp);
  585. rULSPOS = temp;
  586. if ((res = NLP_AUX_Find(bupstem, 0)) < INVALID)
  587. {
  588. return res;
  589. }
  590. char tstem [80];
  591. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  592. if (FindSilsaWord (tstem) & _VERB)
  593. {
  594. lstrcat (lrgsz, tstem);
  595. vbuf [wcount++] = POS_VERB;
  596. return Cikha_VALID;
  597. }
  598. return BT;
  599. }
  600. __RepStem1(bupstem, rULSPOS, __V_l);
  601. if ((res = NLP_AUX_Find(bupstem, 0)) < INVALID)
  602. {
  603. return res;
  604. }
  605. char tstem [80];
  606. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  607. if (FindSilsaWord (tstem) & _VERB)
  608. {
  609. lstrcat (lrgsz, tstem);
  610. vbuf [wcount++] = POS_VERB;
  611. return Cikha_VALID;
  612. }
  613. if (ACT_N_E == 1 && bupstem[rULSPOS-2] >= __V_k)
  614. {
  615. return Machine_T;
  616. }
  617. return BT;
  618. }
  619. // ----------------------------------------------------------------------
  620. //
  621. //
  622. // ----------------------------------------------------------------------
  623. int BaseEngine::NLP_Cikha_SS_Vu_irr(char *stem,
  624. char *ending)
  625. {
  626. char bupstem[80];
  627. int res, rULSPOS;
  628. rULSPOS = lstrlen(stem)-1;
  629. lstrcpy(bupstem,stem);
  630. if (FindIrrWord(bupstem, _ZUV_YO) & FINAL)
  631. {
  632. char tstem [80];
  633. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  634. lstrcat (lrgsz, tstem);
  635. vbuf [wcount++] = POS_VERB;
  636. return Cikha_VALID;
  637. }
  638. __RepStem1(bupstem, rULSPOS, __V_l);
  639. if ((res = NLP_AUX_Find(bupstem, 0)) < INVALID)
  640. {
  641. return res;
  642. }
  643. char tstem [80];
  644. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  645. if (FindSilsaWord (tstem) & _VERB)
  646. {
  647. char tstem [80];
  648. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  649. lstrcat (lrgsz, tstem);
  650. vbuf [wcount++] = POS_VERB;
  651. return Cikha_VALID;
  652. }
  653. return BT;
  654. }
  655. // ----------------------------------------------------------------------
  656. //
  657. //
  658. // ----------------------------------------------------------------------
  659. int BaseEngine::NLP_Cikha_SS_Vnj(char *stem,
  660. char *ending)
  661. {
  662. char bupstem[80];
  663. int res, rULSPOS, temp;
  664. rULSPOS = lstrlen(stem)-1;
  665. lstrcpy(bupstem,stem);
  666. __RepStem1(bupstem, rULSPOS, __V_n);
  667. if ((res = NLP_AUX_Find(bupstem, 0)) < INVALID)
  668. {
  669. return res;
  670. }
  671. char tstem [80];
  672. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  673. if (FindSilsaWord (tstem) & _VERB)
  674. {
  675. lstrcat (lrgsz, tstem);
  676. vbuf [wcount++] = POS_VERB;
  677. return Cikha_VALID;
  678. }
  679. if (__IsDefStem(rULSPOS, 1) == 1 && bupstem[rULSPOS-1] == __K_I)
  680. {
  681. temp = rULSPOS;
  682. __DelStem1(bupstem, &temp);
  683. rULSPOS = temp;
  684. __RepStem1(bupstem, rULSPOS, __K_B);
  685. if (FindIrrWord(bupstem, _IV_BM) & FINAL)
  686. {
  687. char tstem [80];
  688. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  689. lstrcat (lrgsz, tstem);
  690. vbuf [wcount++] = POS_VERB;
  691. return Cikha_VALID;
  692. }
  693. }
  694. return BT;
  695. }
  696. // ----------------------------------------------------------------------
  697. //
  698. //
  699. // ----------------------------------------------------------------------
  700. int BaseEngine::NLP_Cikha_SS_Vhk(char *stem,
  701. char *ending)
  702. {
  703. char bupstem[80];
  704. int res, rULSPOS, temp;
  705. rULSPOS = lstrlen(stem)-1;
  706. lstrcpy(bupstem,stem);
  707. __RepStem1(bupstem, rULSPOS, __V_h);
  708. if ((res = NLP_AUX_Find(bupstem, 0)) < INVALID)
  709. {
  710. return res;
  711. }
  712. char tstem [80];
  713. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  714. if (FindSilsaWord (tstem) & _VERB)
  715. {
  716. char tstem [80];
  717. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  718. lstrcat (lrgsz, tstem);
  719. vbuf [wcount++] = POS_VERB;
  720. return Cikha_VALID;
  721. }
  722. if (__IsDefStem(rULSPOS, 1) == 1 && bupstem[rULSPOS-1] == __K_I)
  723. {
  724. temp = rULSPOS;
  725. __DelStem1(bupstem, &temp);
  726. rULSPOS = temp;
  727. __RepStem1(bupstem, rULSPOS, __K_B);
  728. if (FindIrrWord(bupstem, _IV_BP) & FINAL)
  729. {
  730. char tstem [80];
  731. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  732. lstrcat (lrgsz, tstem);
  733. vbuf [wcount++] = POS_VERB;
  734. return Cikha_VALID;
  735. }
  736. }
  737. return BT;
  738. }
  739. // ----------------------------------------------------------------------
  740. //
  741. //
  742. // ----------------------------------------------------------------------
  743. int BaseEngine::NLP_Cikha_SS_Vho(char *stem,
  744. char *ending)
  745. {
  746. char bupstem[80];
  747. int res, rULSPOS;
  748. rULSPOS = lstrlen(stem)-1;
  749. lstrcpy(bupstem,stem);
  750. __RepStem1(bupstem, rULSPOS, __V_hl);
  751. if ((res = NLP_AUX_Find(bupstem, 0)) < INVALID)
  752. {
  753. return res;
  754. }
  755. char tstem [80];
  756. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  757. if (FindSilsaWord (tstem) & _VERB)
  758. {
  759. lstrcat (lrgsz, tstem);
  760. vbuf [wcount++] = POS_VERB;
  761. return Cikha_VALID;
  762. }
  763. return BT;
  764. }
  765. // ----------------------------------------------------------------------
  766. //
  767. //
  768. // ----------------------------------------------------------------------
  769. int BaseEngine::NLP_Cikha_SS_Vo_KH(char *stem,
  770. char *ending)
  771. {
  772. char bupstem[80];
  773. int res, rULSPOS;
  774. rULSPOS = lstrlen(stem)-1;
  775. lstrcpy(bupstem,stem);
  776. __RepStem1(bupstem, rULSPOS, __V_k);
  777. if ((res = NLP_AUX_Find(bupstem, 0)) < INVALID)
  778. {
  779. return res;
  780. }
  781. char tstem [80];
  782. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  783. if (FindSilsaWord (tstem) & _VERB)
  784. {
  785. lstrcat (lrgsz, tstem);
  786. vbuf [wcount++] = POS_VERB;
  787. return Cikha_VALID;
  788. }
  789. return BT;
  790. }
  791. // ----------------------------------------------------------------------
  792. //
  793. //
  794. // ----------------------------------------------------------------------
  795. int BaseEngine::NLP_Cikha_SS_Vo(char *stem,
  796. char *ending)
  797. {
  798. char bupstem[80];
  799. int res, rULSPOS;
  800. rULSPOS = lstrlen(stem)-1;
  801. lstrcpy(bupstem,stem);
  802. if ((res = NLP_AUX_Find(bupstem, 0)) < INVALID)
  803. {
  804. return res;
  805. }
  806. char tstem [80];
  807. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  808. if (FindSilsaWord (tstem) & _VERB)
  809. {
  810. lstrcat (lrgsz, tstem);
  811. vbuf [wcount++] = POS_VERB;
  812. return Cikha_VALID;
  813. }
  814. return BT;
  815. }
  816. // ----------------------------------------------------------------------
  817. //
  818. //
  819. // ----------------------------------------------------------------------
  820. int BaseEngine::NLP_Cikha_SS_Vp( char *stem)
  821. {
  822. char bupstem[80];
  823. int rULSPOS;
  824. rULSPOS = lstrlen(stem)-1;
  825. lstrcpy(bupstem,stem);
  826. if (FindIrrWord(bupstem, _ZUV_E) & FINAL)
  827. {
  828. char tstem [80];
  829. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  830. lstrcat (lrgsz, tstem);
  831. vbuf [wcount++] = POS_VERB;
  832. return Cikha_VALID;
  833. }
  834. return BT;
  835. }
  836. // ----------------------------------------------------------------------
  837. //
  838. //
  839. // ----------------------------------------------------------------------
  840. int BaseEngine::NLP_Cikha_SS_Vil( char *stem)
  841. {
  842. char bupstem[80];
  843. int rULSPOS, temp;
  844. rULSPOS = lstrlen(stem)-1;
  845. lstrcpy(bupstem,stem);
  846. if (__IsDefStem(rULSPOS, 1) == 1 && bupstem[rULSPOS-1] == __K_I)
  847. {
  848. __RepStem1(bupstem, rULSPOS, __V_i);
  849. temp = rULSPOS;
  850. __AddStem1(bupstem, &temp, __K_H);
  851. rULSPOS = temp;
  852. if (FindIrrWord(bupstem, _IA_HP) & FINAL)
  853. {
  854. char tstem [80];
  855. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  856. lstrcat (lrgsz, tstem);
  857. vbuf [wcount++] = POS_ADJECTIVE;
  858. return Cikha_VALID;
  859. }
  860. __RepStem2(bupstem, rULSPOS, __V_u, __K_H);
  861. if (FindIrrWord(bupstem, _IA_HM) & FINAL)
  862. {
  863. char tstem [80];
  864. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  865. lstrcat (lrgsz, tstem);
  866. vbuf [wcount++] = POS_ADJECTIVE;
  867. return Cikha_VALID;
  868. }
  869. }
  870. return BT;
  871. }
  872. // ----------------------------------------------------------------------
  873. //
  874. //
  875. // ----------------------------------------------------------------------
  876. int BaseEngine::NLP_Cikha_SS_Vul( char *stem)
  877. {
  878. char bupstem[80];
  879. int temp, rULSPOS;
  880. rULSPOS = lstrlen(stem)-1;
  881. lstrcpy(bupstem,stem);
  882. if (__IsDefStem(rULSPOS, 1) == 1 && bupstem[rULSPOS-1] == __K_I)
  883. {
  884. __RepStem1(bupstem, rULSPOS, __V_u);
  885. temp = rULSPOS;
  886. __AddStem1(bupstem, &temp, __K_H);
  887. rULSPOS = temp;
  888. if (FindIrrWord(bupstem, _IA_HM) & FINAL)
  889. {
  890. char tstem [80];
  891. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  892. lstrcat (lrgsz, tstem);
  893. vbuf [wcount++] = POS_ADJECTIVE;
  894. return Cikha_VALID;
  895. }
  896. }
  897. return BT;
  898. }
  899. // ----------------------------------------------------------------------
  900. //
  901. //
  902. // ----------------------------------------------------------------------
  903. int BaseEngine::NLP_Cikha_SS_Vj_KR( char *stem)
  904. {
  905. char bupstem[80];
  906. int rULSPOS, temp;
  907. rULSPOS = lstrlen(stem)-1;
  908. lstrcpy(bupstem,stem);
  909. temp = rULSPOS;
  910. __DelStem2(bupstem, &temp);
  911. rULSPOS = temp;
  912. if (bupstem[rULSPOS] == __K_R)
  913. {
  914. temp = rULSPOS;
  915. __AddStem1(bupstem, &temp, __V_m);
  916. rULSPOS = temp;
  917. if (FindIrrWord(bupstem, _IV_RmM) & FINAL)
  918. {
  919. char tstem [80];
  920. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  921. lstrcat (lrgsz, tstem);
  922. vbuf [wcount++] = POS_VERB;
  923. return Cikha_VALID;
  924. }
  925. temp = rULSPOS;
  926. __DelStem1(bupstem, &temp);
  927. __AddStem2(bupstem, &temp, __K_R, __V_m);
  928. rULSPOS = temp;
  929. if (FindIrrWord(bupstem, _IV_OmM) & FINAL)
  930. {
  931. char tstem [80];
  932. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  933. lstrcat (lrgsz, tstem);
  934. vbuf [wcount++] = POS_VERB;
  935. return Cikha_VALID;
  936. }
  937. return BT;
  938. }
  939. temp = rULSPOS;
  940. __AddStem2(bupstem, &temp, __K_R, __V_m);
  941. rULSPOS = temp;
  942. if (FindIrrWord(bupstem, _IV_OmM) & FINAL) //v8-
  943. {
  944. char tstem [80];
  945. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  946. lstrcat (lrgsz, tstem);
  947. vbuf [wcount++] = POS_VERB;
  948. return Cikha_VALID;
  949. }
  950. return BT;
  951. }
  952. // ----------------------------------------------------------------------
  953. //
  954. //
  955. // ----------------------------------------------------------------------
  956. int BaseEngine::NLP_Cikha_SS_Vj( char *stem)
  957. {
  958. char bupstem[80];
  959. int rULSPOS;
  960. rULSPOS = lstrlen(stem)-1;
  961. lstrcpy(bupstem,stem);
  962. if (__IsDefStem(rULSPOS, 1) == 1 && __IsDefStem(rULSPOS, 2) == 0 &&
  963. bupstem[rULSPOS-1] == __K_P && bupstem[rULSPOS] == __V_j)
  964. {
  965. char tstem [80];
  966. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  967. lstrcat (lrgsz, tstem);
  968. vbuf [wcount++] = POS_VERB;
  969. return Cikha_VALID;
  970. }
  971. if (FindIrrWord(bupstem, _ZUV_O) & FINAL)
  972. {
  973. char tstem [80];
  974. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  975. lstrcat (lrgsz, tstem);
  976. vbuf [wcount++] = POS_VERB;
  977. return Cikha_VALID;
  978. }
  979. __RepStem1(bupstem, rULSPOS, __V_m);
  980. if (FindIrrWord(bupstem, _IV_OmM) & FINAL)
  981. {
  982. char tstem [80];
  983. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  984. lstrcat (lrgsz, tstem);
  985. vbuf [wcount++] = POS_VERB;
  986. return Cikha_VALID;
  987. }
  988. return BT;
  989. }
  990. // ----------------------------------------------------------------------
  991. //
  992. //
  993. // ----------------------------------------------------------------------
  994. int BaseEngine::NLP_Cikha_SS_Vk( char *stem,
  995. char *ending)
  996. {
  997. char bupstem[80];
  998. int res, rULSPOS, temp;
  999. rULSPOS = lstrlen(stem)-1;
  1000. lstrcpy(bupstem,stem);
  1001. if (__IsDefStem(rULSPOS, 1) == 1 && bupstem[rULSPOS-1] == __K_H)
  1002. {
  1003. return BT;
  1004. }
  1005. if ((res = NLP_AUX_Find(bupstem, 0)) < INVALID)
  1006. {
  1007. return res;
  1008. }
  1009. if (FindIrrWord(bupstem, _ZUV_A) & FINAL)
  1010. {
  1011. char tstem [80];
  1012. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  1013. lstrcat (lrgsz, tstem);
  1014. vbuf [wcount++] = POS_VERB;
  1015. return Cikha_VALID;
  1016. }
  1017. if (__IsDefStem(rULSPOS, 2) == 1 &&
  1018. bupstem[rULSPOS-1] == __K_R &&
  1019. bupstem[rULSPOS-2] == __K_R)
  1020. {
  1021. temp = rULSPOS;
  1022. __DelStem2(bupstem, &temp);
  1023. __AddStem1(bupstem, &temp, __V_m);
  1024. rULSPOS = temp;
  1025. if (FindIrrWord(bupstem, _IV_RmP) & FINAL)
  1026. {
  1027. char tstem [80];
  1028. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  1029. lstrcat (lrgsz, tstem);
  1030. vbuf [wcount++] = POS_VERB;
  1031. return Cikha_VALID;
  1032. }
  1033. return BT;
  1034. }
  1035. __RepStem1(bupstem, rULSPOS, __V_m);
  1036. if (FindIrrWord(bupstem, _IV_OmP) & FINAL)
  1037. {
  1038. char tstem [80];
  1039. Conv.INS2HAN (bupstem, tstem, codeWanSeong);
  1040. lstrcat (lrgsz, tstem);
  1041. vbuf [wcount++] = POS_VERB;
  1042. return Cikha_VALID;
  1043. }
  1044. return BT;
  1045. }