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.

857 lines
26 KiB

  1. // =========================================================================
  2. // Copyright (C) 1997 - 1998, Microsoft Corporation. All Rights Reserved.
  3. //
  4. // FILE NAME : BASESS.CPP
  5. // Function : BASE ENGINE FUNCTION COLLECTION (SS PROCESS)
  6. // : NLP Base Engine Function
  7. // =========================================================================
  8. #include "basecore.hpp"
  9. #include "basegbl.hpp"
  10. #include "MainDict.h"
  11. char TempIlRm[] = {__K_I, __V_l, __K_R, __V_m, 0};
  12. // ----------------------------------------------------------------------
  13. //
  14. // SSANGSIOS : Main
  15. //
  16. // ----------------------------------------------------------------------
  17. int BaseEngine::NLP_SS_Proc(char *stem,
  18. char *ending)
  19. {
  20. char tmp[80];
  21. int luls;
  22. luls = ULSPOS;
  23. lstrcpy(tmp,stem);
  24. switch (ULS)
  25. {
  26. // We may not use this routine after testing.
  27. /*
  28. case __V_l : // "I"
  29. return NLP_SS_Vl(stem, ending); */
  30. case __V_u : // "YEO"
  31. if(__IsDefStem(ULSPOS, 1) == 1 && stem[ULSPOS-1] == __K_I) // PLS="IEUNG" :stem=..."YEO"
  32. {
  33. return NLP_SS_Vu_mrg(stem, ending);
  34. }
  35. else
  36. {
  37. return NLP_SS_Vu_irr(stem, ending);
  38. }
  39. case __V_nj : // "WEO"
  40. return NLP_SS_Vnj(stem, ending);
  41. case __V_hk : // "WA"
  42. return NLP_SS_Vhk(stem, ending);
  43. case __V_ho : // "WAE"
  44. return NLP_SS_Vho(stem, ending);
  45. case __V_o : // "AE"
  46. if(__IsDefStem(ULSPOS, 1) == 1 && stem[ULSPOS-1] == __K_H) // PLS="HIEUH"
  47. {
  48. return NLP_SS_Vo_KH(stem, ending);
  49. }
  50. else
  51. {
  52. return NLP_SS_Vo(stem, ending);
  53. }
  54. case __V_p : // "E"
  55. return NLP_SS_Vp(stem);
  56. case __V_O : // "YAE"
  57. return NLP_SS_Vil(stem);
  58. case __V_P : // "YE"
  59. return NLP_SS_Vul(stem);
  60. case __V_j : // "EO"
  61. if(__IsDefStem(ULSPOS, 1) == 1 && stem[ULSPOS-1] == __K_R) // PLS="RIEUR"
  62. {
  63. return NLP_SS_Vj_KR(stem);
  64. }
  65. else
  66. {
  67. return NLP_SS_Vj(stem);
  68. }
  69. case __V_k : // "A"
  70. return NLP_SS_Vk(stem, ending);
  71. case __V_np : // "WE"
  72. if(__IsDefStem(ULSPOS, 1) == 1 && __IsDefStem(ULSPOS, 2) == 0 &&
  73. stem[ULSPOS-1] == __K_G_D) // PLS=SSANGKIYEOK
  74. {
  75. char tstem [80];
  76. Conv.INS2HAN (stem, tstem, codeWanSeong);
  77. lstrcat (lrgsz, tstem);
  78. vbuf [wcount++] = POS_VERB;
  79. return SS_VERB_VALID;
  80. }
  81. return INVALID;
  82. default : return BT;
  83. }
  84. }
  85. /*
  86. // ----------------------------------------------------------------------
  87. //
  88. // SSANGSIOS : vowel "I"
  89. //
  90. // ----------------------------------------------------------------------
  91. int BaseEngine::NLP_SS_Vl(char *stem,
  92. char *ending)
  93. {
  94. char dummyl[1],
  95. temp[1],
  96. rULSPOS;
  97. int res;
  98. rULSPOS = ULSPOS;
  99. if(__IsDefStem(rULSPOS, 1) == 1 && stem[rULSPOS-1] == __K_I ) // PLS="I"
  100. {
  101. if(__IsDefEnd(LMEPOS, 0) == 1 && ending[LMEPOS] == __K_S_D) // LME = SSANGSIOS
  102. {
  103. temp[0] = rULSPOS;
  104. __AddStem1(stem, temp, __K_S_D); // Add SSANGSIOS to predicate
  105. rULSPOS = temp[0];
  106. if(FindIrrWord(stem, _ISS) & FINAL)
  107. {
  108. char tstem [80];
  109. Conv.INS2HAN (stem, tstem, codeWanSeong);
  110. lstrcat (lrgsz, tstem);
  111. vbuf [wcount++] = POS_ADJECTIVE;
  112. return SS_ADJ_VALID;
  113. }
  114. if((res = NLP_AUX_Find(stem, 1)) < INVALID) // Adjective
  115. {
  116. return res + SS_AUX;
  117. }
  118. }
  119. return INVALID;
  120. }
  121. return BT;
  122. }
  123. */
  124. // ----------------------------------------------------------------------
  125. //
  126. // SSANGSIOS : vowel "U" (Contraction)
  127. //
  128. // ----------------------------------------------------------------------
  129. int BaseEngine::NLP_SS_Vu_mrg(char *stem,
  130. char *ending)
  131. {
  132. int res, temp, rULSPOS;
  133. rULSPOS = ULSPOS;
  134. if(__IsDefStem(rULSPOS, 3) == 1 &&
  135. stem[rULSPOS-3] == __K_H && stem[rULSPOS-2] == __V_k ) //.ALS == 'HA'
  136. {
  137. temp = rULSPOS;
  138. __DelStem2(stem, &temp); // remove 'YEO'
  139. rULSPOS = temp;
  140. char tstem [80];
  141. Conv.INS2HAN (stem, tstem, codeWanSeong);
  142. if (FindSilsaWord (tstem) & _VERB)
  143. {
  144. lstrcat (lrgsz, tstem);
  145. vbuf [wcount++] = POS_VERB;
  146. return SS_VERB_VALID;
  147. }
  148. Conv.INS2HAN (stem, tstem, codeWanSeong);
  149. if (FindSilsaWord (tstem) & _ADJECTIVE)
  150. {
  151. lstrcat (lrgsz, tstem);
  152. vbuf [wcount++] = POS_ADJECTIVE;
  153. return SS_ADJ_VALID;
  154. }
  155. if((res = NLP_Manha_Proc(stem)) < INVALID)
  156. {
  157. if(res == Manha_VALID)
  158. {
  159. return SS_Manha_VALID;
  160. }
  161. else if(res == Yenha_VALID)
  162. {
  163. return SS_Yenha_VALID;
  164. }
  165. }
  166. else if(NLP_Cikha_Proc(stem) < INVALID)
  167. {
  168. return SS_Cikha_VALID;
  169. }
  170. if((res = NLP_AUX_Find(stem, 0)) < INVALID) // auxiliary verb
  171. {
  172. return res + SS_AUX;
  173. }
  174. if((res = NLP_AUX_Find(stem, 1)) < INVALID) // auxiliary adjective
  175. {
  176. return res + SS_AUX;
  177. }
  178. return BT;
  179. }
  180. __RepStem1(stem, rULSPOS, __V_l); // "YEO" > "I"
  181. char tstem [80];
  182. Conv.INS2HAN (stem, tstem, codeWanSeong);
  183. if (FindSilsaWord (tstem) & _VERB)
  184. {
  185. lstrcat (lrgsz, tstem);
  186. vbuf [wcount++] = POS_VERB;
  187. return SS_VERB_VALID;
  188. }
  189. Conv.INS2HAN (stem, tstem, codeWanSeong);
  190. if (FindSilsaWord (tstem) & _ADJECTIVE)
  191. {
  192. lstrcat (lrgsz, tstem);
  193. vbuf [wcount++] = POS_ADJECTIVE;
  194. return SS_ADJ_VALID;
  195. }
  196. if((res = NLP_AUX_Find(stem, 0)) < INVALID)
  197. {
  198. return res + SS_AUX;
  199. }
  200. if(ACT_N_E == 1)
  201. {
  202. if(stem[rULSPOS-2] >= __V_k)
  203. {
  204. temp = rULSPOS;
  205. __DelStem2(stem, &temp); // remvoe "I"
  206. rULSPOS = temp;
  207. if((res = NLP_Machine_T(stem, ending)) < INVALID)
  208. {
  209. return res + SS_T;
  210. }
  211. }
  212. }
  213. return BT;
  214. }
  215. // ----------------------------------------------------------------------
  216. //
  217. // SSANGSIOS : vowel "YEO" (YEO irregular)
  218. //
  219. // ----------------------------------------------------------------------
  220. int BaseEngine::NLP_SS_Vu_irr(char *stem,
  221. char *ending)
  222. {
  223. int res, rULSPOS;
  224. rULSPOS = ULSPOS;
  225. if(FindIrrWord(stem, _ZUV_YO) & FINAL)
  226. {
  227. char tstem [80];
  228. Conv.INS2HAN (stem, tstem, codeWanSeong);
  229. lstrcat (lrgsz, tstem);
  230. vbuf [wcount++] = POS_VERB;
  231. return SS_VERB_VALID;
  232. }
  233. __RepStem1(stem, rULSPOS, __V_l);
  234. char tstem [80];
  235. Conv.INS2HAN (stem, tstem, codeWanSeong);
  236. if (FindSilsaWord (tstem) & _VERB)
  237. {
  238. lstrcat (lrgsz, tstem);
  239. vbuf [wcount++] = POS_VERB;
  240. return SS_VERB_VALID;
  241. }
  242. Conv.INS2HAN (stem, tstem, codeWanSeong);
  243. if (FindSilsaWord (tstem) & _ADJECTIVE)
  244. {
  245. lstrcat (lrgsz, tstem);
  246. vbuf [wcount++] = POS_ADJECTIVE;
  247. return SS_ADJ_VALID;
  248. }
  249. if(NLP_Manhaeci_Proc(stem) < INVALID)
  250. {
  251. return SS_Manhaeci_VALID;
  252. }
  253. if((res = NLP_AUX_Find(stem, 0)) < INVALID)
  254. {
  255. return res + SS_AUX;
  256. }
  257. if((res = NLP_AUX_Find(stem, 1)) < INVALID)
  258. {
  259. return res + SS_AUX;
  260. }
  261. return BT;
  262. }
  263. // ----------------------------------------------------------------------
  264. //
  265. //
  266. // ----------------------------------------------------------------------
  267. int BaseEngine::NLP_SS_Vnj(char *stem,
  268. char *ending)
  269. {
  270. int res, temp, rULSPOS;
  271. rULSPOS = ULSPOS;
  272. __RepStem1(stem, rULSPOS, __V_n);
  273. char tstem [80];
  274. Conv.INS2HAN (stem, tstem, codeWanSeong);
  275. if (FindSilsaWord (tstem) & _VERB)
  276. {
  277. lstrcat (lrgsz, tstem);
  278. vbuf [wcount++] = POS_VERB;
  279. return SS_VERB_VALID;
  280. }
  281. if((res = NLP_AUX_Find(stem, 0)) < INVALID)
  282. {
  283. return res + SS_AUX;
  284. }
  285. if(__IsDefStem(rULSPOS, 1) == 1 && stem[rULSPOS-1] == __K_I)
  286. {
  287. temp = rULSPOS;
  288. __DelStem1(stem, &temp);
  289. rULSPOS = temp;
  290. __RepStem1(stem, rULSPOS, __K_B);
  291. if(FindIrrWord(stem, _IV_BM) & FINAL)
  292. {
  293. char tstem [80];
  294. Conv.INS2HAN (stem, tstem, codeWanSeong);
  295. lstrcat (lrgsz, tstem);
  296. vbuf [wcount++] = POS_VERB;
  297. return SS_VERB_VALID;
  298. }
  299. if(FindIrrWord(stem, _RA_B) & FINAL)
  300. {
  301. return INVALID;
  302. }
  303. if(FindIrrWord(stem, _IA_BP) & FINAL)
  304. {
  305. return INVALID;
  306. }
  307. char tstem [80];
  308. Conv.INS2HAN (stem, tstem, codeWanSeong);
  309. if (FindSilsaWord (tstem) & _ADJECTIVE)
  310. {
  311. lstrcat (lrgsz, tstem);
  312. vbuf [wcount++] = POS_ADJECTIVE;
  313. return SS_ADJ_VALID;
  314. }
  315. if(NLP_Dap_Proc(stem) < INVALID)
  316. {
  317. return SS_Dap_VALID;
  318. }
  319. }
  320. return BT;
  321. }
  322. // ----------------------------------------------------------------------
  323. //
  324. //
  325. // ----------------------------------------------------------------------
  326. int BaseEngine::NLP_SS_Vhk(char *stem,
  327. char *ending)
  328. {
  329. int res, temp, rULSPOS;
  330. rULSPOS = ULSPOS;
  331. __RepStem1(stem, ULSPOS, __V_h);
  332. char tstem [80];
  333. Conv.INS2HAN (stem, tstem, codeWanSeong);
  334. if (FindSilsaWord (tstem) & _VERB)
  335. {
  336. lstrcat (lrgsz, tstem);
  337. vbuf [wcount++] = POS_VERB;
  338. return SS_VERB_VALID;
  339. }
  340. if((res = NLP_AUX_Find(stem, 0)) < INVALID)
  341. {
  342. return res + SS_AUX;
  343. }
  344. if(__IsDefStem(rULSPOS, 1) == 1 && stem[rULSPOS-1] == __K_I)
  345. {
  346. temp = rULSPOS;
  347. __DelStem1(stem, &temp);
  348. rULSPOS = temp;
  349. __RepStem1(stem, rULSPOS, __K_B);
  350. if(FindIrrWord(stem, _IV_BP) & FINAL)
  351. {
  352. char tstem [80];
  353. Conv.INS2HAN (stem, tstem, codeWanSeong);
  354. lstrcat (lrgsz, tstem);
  355. vbuf [wcount++] = POS_VERB;
  356. return SS_VERB_VALID;
  357. }
  358. if(FindIrrWord(stem, _IA_BP) & FINAL)
  359. {
  360. char tstem [80];
  361. Conv.INS2HAN (stem, tstem, codeWanSeong);
  362. lstrcat (lrgsz, tstem);
  363. vbuf [wcount++] = POS_ADJECTIVE;
  364. return SS_ADJ_VALID;
  365. }
  366. }
  367. return BT;
  368. }
  369. // ----------------------------------------------------------------------
  370. //
  371. //
  372. // ----------------------------------------------------------------------
  373. int BaseEngine::NLP_SS_Vho(char *stem,
  374. char *ending)
  375. {
  376. int res, rULSPOS;
  377. rULSPOS = ULSPOS;
  378. __RepStem1(stem, rULSPOS, __V_hl);
  379. char tstem [80];
  380. Conv.INS2HAN (stem, tstem, codeWanSeong);
  381. if (FindSilsaWord (tstem) & _VERB)
  382. {
  383. lstrcat (lrgsz, tstem);
  384. vbuf [wcount++] = POS_VERB;
  385. return SS_VERB_VALID;
  386. }
  387. Conv.INS2HAN (stem, tstem, codeWanSeong);
  388. if (FindSilsaWord (tstem) & _ADJECTIVE)
  389. {
  390. lstrcat (lrgsz, tstem);
  391. vbuf [wcount++] = POS_ADJECTIVE;
  392. return SS_ADJ_VALID;
  393. }
  394. if((res = NLP_AUX_Find(stem, 0)) < INVALID)
  395. {
  396. return res + SS_AUX;
  397. }
  398. return BT;
  399. }
  400. // ----------------------------------------------------------------------
  401. //
  402. //
  403. // ----------------------------------------------------------------------
  404. int BaseEngine::NLP_SS_Vo_KH(char *stem,
  405. char *ending)
  406. {
  407. int res, rULSPOS;
  408. rULSPOS = ULSPOS;
  409. __RepStem1(stem, rULSPOS, __V_k);
  410. char tstem [80];
  411. Conv.INS2HAN (stem, tstem, codeWanSeong);
  412. if (FindSilsaWord (tstem) & _VERB)
  413. {
  414. lstrcat (lrgsz, tstem);
  415. vbuf [wcount++] = POS_VERB;
  416. return SS_VERB_VALID;
  417. }
  418. Conv.INS2HAN (stem, tstem, codeWanSeong);
  419. if (FindSilsaWord (tstem) & _ADJECTIVE)
  420. {
  421. lstrcat (lrgsz, tstem);
  422. vbuf [wcount++] = POS_ADJECTIVE;
  423. return SS_ADJ_VALID;
  424. }
  425. if((res = NLP_Manha_Proc(stem)) < INVALID)
  426. {
  427. if(res == Manha_VALID)
  428. {
  429. return SS_Manha_VALID;
  430. }
  431. else if(res == Yenha_VALID)
  432. {
  433. return SS_Yenha_VALID;
  434. }
  435. }
  436. else if(NLP_Cikha_Proc(stem) < INVALID)
  437. {
  438. return SS_Cikha_VALID;
  439. }
  440. if((res = NLP_AUX_Find(stem, 0)) < INVALID)
  441. {
  442. return res + SS_AUX;
  443. }
  444. if((res = NLP_AUX_Find(stem, 1)) != MORECHECK)
  445. {
  446. return res + SS_AUX;
  447. }
  448. return BT;
  449. }
  450. // ----------------------------------------------------------------------
  451. //
  452. //
  453. // ----------------------------------------------------------------------
  454. int BaseEngine::NLP_SS_Vo(char *stem,
  455. char *ending)
  456. {
  457. int res, temp, rULSPOS;
  458. rULSPOS = ULSPOS;
  459. char tstem [80];
  460. Conv.INS2HAN (stem, tstem, codeWanSeong);
  461. if (FindSilsaWord (tstem) & _VERB)
  462. {
  463. lstrcat (lrgsz, tstem);
  464. vbuf [wcount++] = POS_VERB;
  465. return SS_VERB_VALID;
  466. }
  467. if(FindIrrWord(stem, _ZUA_AE) & FINAL)
  468. {
  469. char tstem [80];
  470. Conv.INS2HAN (stem, tstem, codeWanSeong);
  471. lstrcat (lrgsz, tstem);
  472. vbuf [wcount++] = POS_ADJECTIVE;
  473. return SS_ADJ_VALID;
  474. }
  475. if((res = NLP_AUX_Find(stem, 0)) < INVALID)
  476. {
  477. return res + SS_AUX;
  478. }
  479. __RepStem1(stem, rULSPOS, __V_k);
  480. temp = rULSPOS;
  481. __AddStem1(stem, &temp, __K_H);
  482. rULSPOS = temp;
  483. if(FindIrrWord(stem, _IA_HP) & FINAL)
  484. {
  485. char tstem [80];
  486. Conv.INS2HAN (stem, tstem, codeWanSeong);
  487. lstrcat (lrgsz, tstem);
  488. vbuf [wcount++] = POS_ADJECTIVE;
  489. return SS_ADJ_VALID;
  490. }
  491. __RepStem2(stem, rULSPOS, __V_j, __K_H);
  492. if(FindIrrWord(stem, _IA_HM) & FINAL)
  493. {
  494. char tstem [80];
  495. Conv.INS2HAN (stem, tstem, codeWanSeong);
  496. lstrcat (lrgsz, tstem);
  497. vbuf [wcount++] = POS_ADJECTIVE;
  498. return SS_ADJ_VALID;
  499. }
  500. return BT;
  501. }
  502. // ----------------------------------------------------------------------
  503. //
  504. //
  505. // ----------------------------------------------------------------------
  506. int BaseEngine::NLP_SS_Vp( char *stem)
  507. {
  508. int temp, rULSPOS;
  509. rULSPOS = ULSPOS;
  510. if(FindIrrWord(stem, _ZUV_E) & FINAL)
  511. {
  512. char tstem [80];
  513. Conv.INS2HAN (stem, tstem, codeWanSeong);
  514. lstrcat (lrgsz, tstem);
  515. vbuf [wcount++] = POS_VERB;
  516. return SS_VERB_VALID;
  517. }
  518. if(FindIrrWord(stem, _ZUA_E) & FINAL)
  519. {
  520. char tstem [80];
  521. Conv.INS2HAN (stem, tstem, codeWanSeong);
  522. lstrcat (lrgsz, tstem);
  523. vbuf [wcount++] = POS_ADJECTIVE;
  524. return SS_ADJ_VALID;
  525. }
  526. __RepStem1(stem, rULSPOS, __V_j);
  527. temp = rULSPOS;
  528. __AddStem1(stem, &temp, __K_H);
  529. rULSPOS = temp;
  530. if(FindIrrWord(stem, _IA_HM) & FINAL)
  531. {
  532. char tstem [80];
  533. Conv.INS2HAN (stem, tstem, codeWanSeong);
  534. lstrcat (lrgsz, tstem);
  535. vbuf [wcount++] = POS_ADJECTIVE;
  536. return SS_ADJ_VALID;
  537. }
  538. return BT;
  539. }
  540. // ----------------------------------------------------------------------
  541. //
  542. //
  543. // ----------------------------------------------------------------------
  544. int BaseEngine::NLP_SS_Vil( char *stem)
  545. {
  546. int temp, rULSPOS;
  547. rULSPOS = ULSPOS;
  548. if(__IsDefStem(rULSPOS, 1) == 1 && stem[rULSPOS-1] == __K_I)
  549. {
  550. __RepStem1(stem, rULSPOS, __V_i);
  551. temp = rULSPOS;
  552. __AddStem1(stem, &temp, __K_H);
  553. rULSPOS = temp;
  554. if(FindIrrWord(stem, _IA_HP) & FINAL)
  555. {
  556. char tstem [80];
  557. Conv.INS2HAN (stem, tstem, codeWanSeong);
  558. lstrcat (lrgsz, tstem);
  559. vbuf [wcount++] = POS_ADJECTIVE;
  560. return SS_ADJ_VALID;
  561. }
  562. __RepStem2(stem, rULSPOS, __V_u, __K_H);
  563. if(FindIrrWord(stem, _IA_HM) & FINAL)
  564. {
  565. char tstem [80];
  566. Conv.INS2HAN (stem, tstem, codeWanSeong);
  567. lstrcat (lrgsz, tstem);
  568. vbuf [wcount++] = POS_ADJECTIVE;
  569. return SS_ADJ_VALID;
  570. }
  571. }
  572. return BT;
  573. }
  574. // ----------------------------------------------------------------------
  575. //
  576. //
  577. // ----------------------------------------------------------------------
  578. int BaseEngine::NLP_SS_Vul( char *stem)
  579. {
  580. int temp, rULSPOS;
  581. rULSPOS = ULSPOS;
  582. if(__IsDefStem(rULSPOS, 1) == 1 && stem[rULSPOS-1] == __K_I)
  583. {
  584. __RepStem1(stem, rULSPOS, __V_u);
  585. temp = rULSPOS;
  586. __AddStem1(stem, &temp, __K_H);
  587. rULSPOS = temp;
  588. if(FindIrrWord(stem, _IA_HM) & FINAL)
  589. {
  590. char tstem [80];
  591. Conv.INS2HAN (stem, tstem, codeWanSeong);
  592. lstrcat (lrgsz, tstem);
  593. vbuf [wcount++] = POS_ADJECTIVE;
  594. return SS_ADJ_VALID;
  595. }
  596. }
  597. return BT;
  598. }
  599. // ----------------------------------------------------------------------
  600. //
  601. //
  602. // ----------------------------------------------------------------------
  603. int BaseEngine::NLP_SS_Vj_KR( char *stem)
  604. {
  605. int temp, rULSPOS;
  606. rULSPOS = ULSPOS;
  607. temp = rULSPOS;
  608. __DelStem2(stem, &temp);
  609. rULSPOS = temp;
  610. if(__IsDefStem(rULSPOS, 1) == 1 &&
  611. stem[rULSPOS-1] == __K_R && stem[rULSPOS] == __V_m)
  612. {
  613. if(strcmp(stem, TempIlRm) == 0)
  614. {
  615. char tstem [80];
  616. Conv.INS2HAN (stem, tstem, codeWanSeong);
  617. lstrcat (lrgsz, tstem);
  618. vbuf [wcount++] = POS_VERB;
  619. return SS_VERB_VALID;
  620. }
  621. if(FindIrrWord(stem, _IA_Rj) & FINAL)
  622. {
  623. char tstem [80];
  624. Conv.INS2HAN (stem, tstem, codeWanSeong);
  625. lstrcat (lrgsz, tstem);
  626. vbuf [wcount++] = POS_ADJECTIVE;
  627. return SS_ADJ_VALID;
  628. }
  629. return BT;
  630. }
  631. if(stem[rULSPOS] == __K_R)
  632. {
  633. temp = rULSPOS;
  634. __AddStem1(stem, &temp, __V_m);
  635. rULSPOS = temp;
  636. if(FindIrrWord(stem, _IV_RmM) & FINAL)
  637. {
  638. char tstem [80];
  639. Conv.INS2HAN (stem, tstem, codeWanSeong);
  640. lstrcat (lrgsz, tstem);
  641. vbuf [wcount++] = POS_VERB;
  642. return SS_VERB_VALID;
  643. }
  644. if(FindIrrWord(stem, _IA_RmM) & FINAL)
  645. {
  646. char tstem [80];
  647. Conv.INS2HAN (stem, tstem, codeWanSeong);
  648. lstrcat (lrgsz, tstem);
  649. vbuf [wcount++] = POS_ADJECTIVE;
  650. return SS_ADJ_VALID;
  651. }
  652. temp = rULSPOS;
  653. __DelStem1(stem, &temp);
  654. __AddStem2(stem, &temp, __K_R, __V_m);
  655. rULSPOS = temp;
  656. if(FindIrrWord(stem, _IV_OmM) & FINAL)
  657. {
  658. char tstem [80];
  659. Conv.INS2HAN (stem, tstem, codeWanSeong);
  660. lstrcat (lrgsz, tstem);
  661. vbuf [wcount++] = POS_VERB;
  662. return SS_VERB_VALID;
  663. }
  664. return BT;
  665. }
  666. temp = rULSPOS;
  667. __AddStem2(stem, &temp, __K_R, __V_m);
  668. rULSPOS = temp;
  669. if(FindIrrWord(stem, _IV_OmM) & FINAL) //v8-
  670. {
  671. char tstem [80];
  672. Conv.INS2HAN (stem, tstem, codeWanSeong);
  673. lstrcat (lrgsz, tstem);
  674. vbuf [wcount++] = POS_VERB;
  675. return SS_VERB_VALID;
  676. }
  677. return BT;
  678. }
  679. // ----------------------------------------------------------------------
  680. //
  681. //
  682. // ----------------------------------------------------------------------
  683. int BaseEngine::NLP_SS_Vj( char *stem)
  684. {
  685. int rULSPOS;
  686. char PHieph_U[3]={'\xC7', '\xAA',0};
  687. rULSPOS = ULSPOS;
  688. if(__IsDefStem(rULSPOS, 1) == 1 && __IsDefStem(rULSPOS, 2) == 0 &&
  689. stem[rULSPOS-1] == __K_P && stem[rULSPOS] == __V_j)
  690. {
  691. lstrcat (lrgsz,PHieph_U);
  692. vbuf [wcount++] = POS_VERB;
  693. return SS_VERB_VALID;
  694. }
  695. if(FindIrrWord(stem, _ZUV_O) & FINAL)
  696. {
  697. char tstem [80];
  698. Conv.INS2HAN (stem, tstem, codeWanSeong);
  699. lstrcat (lrgsz, tstem);
  700. vbuf [wcount++] = POS_VERB;
  701. return SS_VERB_VALID;
  702. }
  703. __RepStem1(stem, rULSPOS, __V_m);
  704. if(FindIrrWord(stem, _IV_OmM) & FINAL)
  705. {
  706. char tstem [80];
  707. Conv.INS2HAN (stem, tstem, codeWanSeong);
  708. lstrcat (lrgsz, tstem);
  709. vbuf [wcount++] = POS_VERB;
  710. return SS_VERB_VALID;
  711. }
  712. if(FindIrrWord(stem, _IA_OmM) & FINAL)
  713. {
  714. char tstem [80];
  715. Conv.INS2HAN (stem, tstem, codeWanSeong);
  716. lstrcat (lrgsz, tstem);
  717. vbuf [wcount++] = POS_ADJECTIVE;
  718. return SS_ADJ_VALID;
  719. }
  720. return BT;
  721. }
  722. // ----------------------------------------------------------------------
  723. //
  724. //
  725. // ----------------------------------------------------------------------
  726. int BaseEngine::NLP_SS_Vk( char *stem,
  727. char *ending)
  728. {
  729. int res, temp, rULSPOS;
  730. rULSPOS = ULSPOS;
  731. if(FindIrrWord(stem, _ZUV_A) & FINAL)
  732. {
  733. char tstem [80];
  734. Conv.INS2HAN (stem, tstem, codeWanSeong);
  735. lstrcat (lrgsz, tstem);
  736. vbuf [wcount++] = POS_VERB;
  737. return SS_VERB_VALID;
  738. }
  739. if(__IsDefStem(rULSPOS, 1) == 1 && stem[rULSPOS-1] == __K_H)
  740. {
  741. return BT;
  742. }
  743. if(FindIrrWord(stem, _ZUA_A) & FINAL)
  744. {
  745. char tstem [80];
  746. Conv.INS2HAN (stem, tstem, codeWanSeong);
  747. lstrcat (lrgsz, tstem);
  748. vbuf [wcount++] = POS_ADJECTIVE;
  749. return SS_ADJ_VALID;
  750. }
  751. if((res = NLP_AUX_Find(stem, 0)) < INVALID)
  752. {
  753. return res + SS_AUX;
  754. }
  755. if(__IsDefStem(rULSPOS, 2) == 1 &&
  756. stem[rULSPOS-1] == __K_R &&
  757. stem[rULSPOS-2] == __K_R)
  758. {
  759. temp = rULSPOS;
  760. __DelStem2(stem, &temp);
  761. __AddStem1(stem, &temp, __V_m);
  762. rULSPOS = temp;
  763. if(FindIrrWord(stem, _IV_RmP) & FINAL)
  764. {
  765. char tstem [80];
  766. Conv.INS2HAN (stem, tstem, codeWanSeong);
  767. lstrcat (lrgsz, tstem);
  768. vbuf [wcount++] = POS_VERB;
  769. return SS_VERB_VALID;
  770. }
  771. if(FindIrrWord(stem, _IA_RmP) & FINAL)
  772. {
  773. char tstem [80];
  774. Conv.INS2HAN (stem, tstem, codeWanSeong);
  775. lstrcat (lrgsz, tstem);
  776. vbuf [wcount++] = POS_ADJECTIVE;
  777. return SS_ADJ_VALID;
  778. }
  779. return BT;
  780. }
  781. __RepStem1(stem, rULSPOS, __V_m);
  782. if(FindIrrWord(stem, _IV_OmP) & FINAL)
  783. {
  784. char tstem [80];
  785. Conv.INS2HAN (stem, tstem, codeWanSeong);
  786. lstrcat (lrgsz, tstem);
  787. vbuf [wcount++] = POS_VERB;
  788. return SS_VERB_VALID;
  789. }
  790. if(FindIrrWord(stem, _IA_OmP) & FINAL)
  791. {
  792. char tstem [80];
  793. Conv.INS2HAN (stem, tstem, codeWanSeong);
  794. lstrcat (lrgsz, tstem);
  795. vbuf [wcount++] = POS_ADJECTIVE;
  796. return SS_ADJ_VALID;
  797. }
  798. if(NLP_Gop_Proc(stem) < INVALID)
  799. {
  800. return SS_Gop_VALID;
  801. }
  802. return BT;
  803. }