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.

1846 lines
63 KiB

  1. // =========================================================================
  2. // Copyright (C) 1997 - 1998, Microsoft Corporation. All Rights Reserved.
  3. //
  4. // File Name : BASEAUX.CPP
  5. // Function : BASE ENGINE FUNCTION COLLECTION (AUX PROCESS)
  6. // : NLP Base Engine Function
  7. // =========================================================================
  8. #include "baseaux.hpp"
  9. #include "MainDict.h"
  10. // Many peoples write verb and auxiliary verb without blank.
  11. // In that case, we have to separate the ending of verb and the stem of auxiliary verb.
  12. // Parameters : incode is reverse order.
  13. // Return value : the start position of the stem of auxiliary verb
  14. // made by dhyu -- 1996.3
  15. int SeparateEnding (char *incode)
  16. {
  17. int len = lstrlen (incode)-1;
  18. if (incode [len] == __K_I && incode [len-1] == __V_j)
  19. return len - 1;
  20. if (incode [len] == __K_I && incode [len-1] == __V_k)
  21. return len - 1;
  22. if (incode [len] == __K_G && incode [len-1] == __V_p)
  23. return len - 1;
  24. if (incode [len] == __K_G && incode [len-1] == __V_h)
  25. return len - 1;
  26. if (incode [len] == __K_J && incode [len-1] == __V_l)
  27. return len - 1;
  28. return 0;
  29. }
  30. //----------------------------------------------------------------------------------------------
  31. //
  32. // Function Name : NLP_AUX_Find()
  33. // Call Functions :
  34. // Description :
  35. //
  36. //----------------------------------------------------------------------------------------------
  37. int BaseEngine::NLP_AUX_Find(char *stem,
  38. char pum)
  39. {
  40. char aux_stem[80],
  41. aux_ending[80],
  42. tmp[80];
  43. int reg, luls, temp;
  44. memset(aux_stem, NULL, 80);
  45. memset(aux_ending, NULL, 80);
  46. lstrcpy(aux_stem, stem);
  47. if((reg = NLP_GET_AUX(aux_stem, aux_ending, pum)) != lTRUE)
  48. {
  49. return reg;
  50. }
  51. lstrcpy(tmp, aux_stem);
  52. luls = AUX_ULSPOS;
  53. if(AUX_ACT_SS == 1)
  54. {
  55. switch(AUXULS)
  56. {
  57. case __V_u :
  58. if((reg = NLP_AUX_SS_Vu(aux_stem)) == Manha_Proc)
  59. {
  60. temp = luls;
  61. __DelStem2(tmp, &temp);
  62. luls = temp;
  63. if((reg = NLP_Manha_Proc(tmp)) < INVALID)
  64. {
  65. if(reg == Manha_VALID)
  66. {
  67. reg = AUX_SS_Manha_VALID;
  68. }
  69. else if(reg == Yenha_VALID)
  70. {
  71. reg = AUX_SS_Yenha_VALID;
  72. }
  73. }
  74. }
  75. else if(reg == Manhaeci_Proc)
  76. {
  77. __RepStem1(tmp, luls, __V_l);
  78. if((reg = NLP_Manhaeci_Proc(tmp)) == Manhaeci_VALID)
  79. {
  80. reg = AUX_SS_Manhaeci_VALID;
  81. }
  82. }
  83. if (reg != MORECHECK)
  84. {
  85. char tstem [80];
  86. lstrcat (lrgsz, "+");
  87. Conv.INR2HAN (aux_ending, tstem, codeWanSeong);
  88. if (lstrlen (tstem) > 2)
  89. {
  90. int mark = SeparateEnding (aux_ending);
  91. if (mark > 0)
  92. {
  93. char tmpending [80];
  94. lstrcpy (tmpending, aux_ending);
  95. Conv.INR2HAN (tmpending+mark, tstem, codeWanSeong);
  96. lstrcat (lrgsz, tstem);
  97. vbuf [wcount++] = POS_ENDING;
  98. lstrcat (lrgsz, "+");
  99. tmpending [mark] = '\0';
  100. Conv.INR2HAN (tmpending, tstem, codeWanSeong);
  101. }
  102. }
  103. lstrcat (lrgsz, tstem);
  104. vbuf [wcount++] = (pum == 0) ? POS_AUXVERB : POS_AUXADJ;
  105. }
  106. return reg;
  107. case __V_nj :
  108. if((reg = NLP_AUX_SS_Vnj(aux_stem)) == Dap_Proc)
  109. {
  110. temp = luls;
  111. __DelStem1(tmp, &temp);
  112. luls = temp;
  113. __RepStem1(tmp, luls, __K_B);
  114. reg = NLP_Dap_Proc(tmp);
  115. if(reg == Dap_VALID)
  116. {
  117. reg = AUX_SS_Dap_VALID;
  118. }
  119. }
  120. if (reg != MORECHECK)
  121. {
  122. char tstem [80];
  123. lstrcat (lrgsz, "+");
  124. Conv.INR2HAN (aux_ending, tstem, codeWanSeong);
  125. if (lstrlen (tstem) > 2)
  126. {
  127. int mark = SeparateEnding (aux_ending);
  128. if (mark > 0)
  129. {
  130. char tmpending [80];
  131. lstrcpy (tmpending, aux_ending);
  132. Conv.INR2HAN (tmpending+mark, tstem, codeWanSeong);
  133. lstrcat (lrgsz, tstem);
  134. vbuf [wcount++] = POS_ENDING;
  135. lstrcat (lrgsz, "+");
  136. tmpending [mark] = '\0';
  137. Conv.INR2HAN (tmpending, tstem, codeWanSeong);
  138. }
  139. }
  140. lstrcat (lrgsz, tstem);
  141. vbuf [wcount++] = (pum == 0) ? POS_AUXVERB : POS_AUXADJ;
  142. }
  143. return reg;
  144. case __V_hk :
  145. reg = NLP_AUX_SS_Vhk(aux_stem);
  146. if (reg != MORECHECK)
  147. {
  148. char tstem [80];
  149. lstrcat (lrgsz, "+");
  150. Conv.INR2HAN (aux_ending, tstem, codeWanSeong);
  151. if (lstrlen (tstem) > 2)
  152. {
  153. int mark = SeparateEnding (aux_ending);
  154. if (mark > 0)
  155. {
  156. char tmpending [80];
  157. lstrcpy (tmpending, aux_ending);
  158. Conv.INR2HAN (tmpending+mark, tstem, codeWanSeong);
  159. lstrcat (lrgsz, tstem);
  160. vbuf [wcount++] = POS_ENDING;
  161. lstrcat (lrgsz, "+");
  162. tmpending [mark] = '\0';
  163. Conv.INR2HAN (tmpending, tstem, codeWanSeong);
  164. }
  165. }
  166. lstrcat (lrgsz, tstem);
  167. vbuf [wcount++] = (pum == 0) ? POS_AUXVERB : POS_AUXADJ;
  168. }
  169. return reg;
  170. case __V_ho :
  171. __RepStem1(tmp, luls, __V_hl);
  172. if(AUX_ACT_VB == 1)
  173. {
  174. char tstem [80];
  175. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  176. if (FindSilsaWord (tstem) & _VERB)
  177. {
  178. lstrcat (lrgsz, tstem);
  179. vbuf [wcount++] = POS_VERB;
  180. lstrcat (lrgsz, "+");
  181. Conv.INR2HAN (aux_ending, tstem, codeWanSeong);
  182. if (lstrlen (tstem) > 2)
  183. {
  184. int mark = SeparateEnding (aux_ending);
  185. if (mark > 0)
  186. {
  187. char tmpending [80];
  188. lstrcpy (tmpending, aux_ending);
  189. Conv.INR2HAN (tmpending+mark, tstem, codeWanSeong);
  190. lstrcat (lrgsz, tstem);
  191. vbuf [wcount++] = POS_ENDING;
  192. lstrcat (lrgsz, "+");
  193. tmpending [mark] = '\0';
  194. Conv.INR2HAN (tmpending, tstem, codeWanSeong);
  195. }
  196. }
  197. lstrcat (lrgsz, tstem);
  198. vbuf [wcount++] = (pum == 0) ? POS_AUXVERB : POS_AUXADJ;
  199. return AUX_SS_VERB_VALID;
  200. }
  201. }
  202. if(AUX_ACT_AD == 1)
  203. {
  204. char tstem [80];
  205. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  206. if (FindSilsaWord (tstem) & _ADJECTIVE)
  207. {
  208. lstrcat (lrgsz, tmp);
  209. vbuf [wcount++] = POS_ADJECTIVE;
  210. lstrcat (lrgsz, "+");
  211. if (lstrlen (tstem) > 2)
  212. {
  213. int mark = SeparateEnding (aux_ending);
  214. if (mark > 0)
  215. {
  216. char tmpending [80];
  217. lstrcpy (tmpending, aux_ending);
  218. Conv.INR2HAN (tmpending+mark, tstem, codeWanSeong);
  219. lstrcat (lrgsz, tstem);
  220. vbuf [wcount++] = POS_ENDING;
  221. lstrcat (lrgsz, "+");
  222. tmpending [mark] = '\0';
  223. Conv.INR2HAN (tmpending, tstem, codeWanSeong);
  224. }
  225. }
  226. lstrcat (lrgsz, tstem);
  227. vbuf [wcount++] = (pum == 0) ? POS_AUXVERB : POS_AUXADJ;
  228. return AUX_SS_ADJ_VALID;
  229. }
  230. }
  231. return MORECHECK;
  232. case __V_o :
  233. if((reg = NLP_AUX_SS_Vo(aux_stem)) == Manha_Proc)
  234. {
  235. __RepStem1(tmp, luls, __V_k);
  236. if((reg = NLP_Manha_Proc(tmp)) < INVALID)
  237. {
  238. if(reg == Manha_VALID)
  239. {
  240. reg = AUX_SS_Manha_VALID;
  241. }
  242. else if(reg == Yenha_VALID)
  243. {
  244. reg = AUX_SS_Yenha_VALID;
  245. }
  246. }
  247. }
  248. if (reg != MORECHECK)
  249. {
  250. char tstem [80];
  251. lstrcat (lrgsz, "+");
  252. Conv.INR2HAN (aux_ending, tstem, codeWanSeong);
  253. if (lstrlen (tstem) > 2)
  254. {
  255. int mark = SeparateEnding (aux_ending);
  256. if (mark > 0)
  257. {
  258. char tmpending [80];
  259. lstrcpy (tmpending, aux_ending);
  260. Conv.INR2HAN (tmpending+mark, tstem, codeWanSeong);
  261. lstrcat (lrgsz, tstem);
  262. vbuf [wcount++] = POS_ENDING;
  263. lstrcat (lrgsz, "+");
  264. tmpending [mark] = '\0';
  265. Conv.INR2HAN (tmpending, tstem, codeWanSeong);
  266. }
  267. }
  268. lstrcat (lrgsz, tstem);
  269. vbuf [wcount++] = (pum == 0) ? POS_AUXVERB : POS_AUXADJ;
  270. }
  271. return reg;
  272. case __V_p :
  273. reg = NLP_AUX_SS_Vp(aux_stem);
  274. if (reg != MORECHECK)
  275. {
  276. char tstem [80];
  277. lstrcat (lrgsz, "+");
  278. Conv.INR2HAN (aux_ending, tstem, codeWanSeong);
  279. if (lstrlen (tstem) > 2)
  280. {
  281. int mark = SeparateEnding (aux_ending);
  282. if (mark > 0)
  283. {
  284. char tmpending [80];
  285. lstrcpy (tmpending, aux_ending);
  286. Conv.INR2HAN (tmpending+mark, tstem, codeWanSeong);
  287. lstrcat (lrgsz, tstem);
  288. vbuf [wcount++] = POS_ENDING;
  289. lstrcat (lrgsz, "+");
  290. tmpending [mark] = '\0';
  291. Conv.INR2HAN (tmpending, tstem, codeWanSeong);
  292. }
  293. }
  294. lstrcat (lrgsz, tstem);
  295. vbuf [wcount++] = (pum == 0) ? POS_AUXVERB : POS_AUXADJ;
  296. }
  297. return reg;
  298. case __V_O :
  299. reg = NLP_AUX_SS_Vil(aux_stem);
  300. if (reg != MORECHECK)
  301. {
  302. char tstem [80];
  303. lstrcat (lrgsz, "+");
  304. Conv.INR2HAN (aux_ending, tstem, codeWanSeong);
  305. if (lstrlen (tstem) > 2)
  306. {
  307. int mark = SeparateEnding (aux_ending);
  308. if (mark > 0)
  309. {
  310. char tmpending [80];
  311. lstrcpy (tmpending, aux_ending);
  312. Conv.INR2HAN (tmpending+mark, tstem, codeWanSeong);
  313. lstrcat (lrgsz, tstem);
  314. vbuf [wcount++] = POS_ENDING;
  315. lstrcat (lrgsz, "+");
  316. tmpending [mark] = '\0';
  317. Conv.INR2HAN (tmpending, tstem, codeWanSeong);
  318. }
  319. }
  320. lstrcat (lrgsz, tstem);
  321. vbuf [wcount++] = (pum == 0) ? POS_AUXVERB : POS_AUXADJ;
  322. }
  323. return reg;
  324. case __V_P :
  325. reg = NLP_AUX_SS_Vul(aux_stem);
  326. if (reg != MORECHECK)
  327. {
  328. char tstem [80];
  329. lstrcat (lrgsz, "+");
  330. Conv.INR2HAN (aux_ending, tstem, codeWanSeong);
  331. if (lstrlen (tstem) > 2)
  332. {
  333. int mark = SeparateEnding (aux_ending);
  334. if (mark > 0)
  335. {
  336. char tmpending [80];
  337. lstrcpy (tmpending, aux_ending);
  338. Conv.INR2HAN (tmpending+mark, tstem, codeWanSeong);
  339. lstrcat (lrgsz, tstem);
  340. vbuf [wcount++] = POS_ENDING;
  341. lstrcat (lrgsz, "+");
  342. tmpending [mark] = '\0';
  343. Conv.INR2HAN (tmpending, tstem, codeWanSeong);
  344. }
  345. }
  346. lstrcat (lrgsz, tstem);
  347. vbuf [wcount++] = (pum == 0) ? POS_AUXVERB : POS_AUXADJ;
  348. }
  349. return reg;
  350. case __V_j :
  351. if(aux_stem[luls-1] == __K_R)
  352. reg = NLP_AUX_SS_Vj_KR(aux_stem);
  353. else
  354. reg = NLP_AUX_SS_Vj(aux_stem);
  355. if (reg != MORECHECK)
  356. {
  357. char tstem [80];
  358. lstrcat (lrgsz, "+");
  359. Conv.INR2HAN (aux_ending, tstem, codeWanSeong);
  360. if (lstrlen (tstem) > 2)
  361. {
  362. int mark = SeparateEnding (aux_ending);
  363. if (mark > 0)
  364. {
  365. char tmpending [80];
  366. lstrcpy (tmpending, aux_ending);
  367. Conv.INR2HAN (tmpending+mark, tstem, codeWanSeong);
  368. lstrcat (lrgsz, tstem);
  369. vbuf [wcount++] = POS_ENDING;
  370. lstrcat (lrgsz, "+");
  371. tmpending [mark] = '\0';
  372. Conv.INR2HAN (tmpending, tstem, codeWanSeong);
  373. }
  374. }
  375. lstrcat (lrgsz, tstem);
  376. vbuf [wcount++] = (pum == 0) ? POS_AUXVERB : POS_AUXADJ;
  377. }
  378. return reg;
  379. case __V_k :
  380. if((reg = NLP_AUX_SS_Vk(aux_stem)) == Gop_Proc)
  381. {
  382. __RepStem1(tmp, luls, __V_m);
  383. reg = NLP_Gop_Proc(tmp);
  384. if(reg == Gop_VALID)
  385. {
  386. reg = AUX_SS_Gop_VALID;
  387. }
  388. }
  389. if (reg != MORECHECK)
  390. {
  391. char tstem [80];
  392. lstrcat (lrgsz, "+");
  393. Conv.INR2HAN (aux_ending, tstem, codeWanSeong);
  394. if (lstrlen (tstem) > 2)
  395. {
  396. int mark = SeparateEnding (aux_ending);
  397. if (mark > 0)
  398. {
  399. char tmpending [80];
  400. lstrcpy (tmpending, aux_ending);
  401. Conv.INR2HAN (tmpending+mark, tstem, codeWanSeong);
  402. lstrcat (lrgsz, tstem);
  403. vbuf [wcount++] = POS_ENDING;
  404. lstrcat (lrgsz, "+");
  405. tmpending [mark] = '\0';
  406. Conv.INR2HAN (tmpending, tstem, codeWanSeong);
  407. }
  408. }
  409. lstrcat (lrgsz, tstem);
  410. vbuf [wcount++] = (pum == 0) ? POS_AUXVERB : POS_AUXADJ;
  411. }
  412. return reg;
  413. case __V_np :
  414. if(__IsDefStem(luls, 1) == 1 && __IsDefStem(luls, 2) == 0 &&
  415. tmp[luls-1] == __K_G_D)
  416. {
  417. char tstem [80];
  418. char SK_WE[3] = {'\xB2', '\xE7', 0};
  419. lstrcat (lrgsz, SK_WE);
  420. vbuf [wcount++] = POS_VERB;
  421. lstrcat (lrgsz, "+");
  422. Conv.INR2HAN (aux_ending, tstem, codeWanSeong);
  423. if (lstrlen (tstem) > 2)
  424. {
  425. int mark = SeparateEnding (aux_ending);
  426. if (mark > 0)
  427. {
  428. char tmpending [80];
  429. lstrcpy (tmpending, aux_ending);
  430. Conv.INR2HAN (tmpending+mark, tstem, codeWanSeong);
  431. lstrcat (lrgsz, tstem);
  432. vbuf [wcount++] = POS_ENDING;
  433. lstrcat (lrgsz, "+");
  434. tmpending [mark] = '\0';
  435. Conv.INR2HAN (tmpending, tstem, codeWanSeong);
  436. }
  437. }
  438. lstrcat (lrgsz, tstem);
  439. vbuf [wcount++] = (pum == 0) ? POS_AUXVERB : POS_AUXADJ;
  440. return AUX_SS_VERB_VALID;
  441. }
  442. return INVALID;
  443. default : return MORECHECK;
  444. }
  445. }
  446. if((reg = NLP_AUX_VCV_Check(aux_stem, aux_ending)) < INVALID)
  447. {
  448. if(AUX_ACT_VB == 1)
  449. {
  450. char tstem [80];
  451. Conv.INS2HAN (aux_stem, tstem, codeWanSeong);
  452. if (FindSilsaWord (tstem) & _VERB)
  453. {
  454. lstrcat (lrgsz, tstem);
  455. vbuf [wcount++] = POS_VERB;
  456. lstrcat (lrgsz, "+");
  457. Conv.INR2HAN (aux_ending, tstem, codeWanSeong);
  458. if (lstrlen (tstem) > 2)
  459. {
  460. int mark = SeparateEnding (aux_ending);
  461. if (mark > 0)
  462. {
  463. char tmpending [80];
  464. lstrcpy (tmpending, aux_ending);
  465. Conv.INR2HAN (tmpending+mark, tstem, codeWanSeong);
  466. lstrcat (lrgsz, tstem);
  467. vbuf [wcount++] = POS_ENDING;
  468. lstrcat (lrgsz, "+");
  469. tmpending [mark] = '\0';
  470. Conv.INR2HAN (tmpending, tstem, codeWanSeong);
  471. }
  472. }
  473. lstrcat (lrgsz, tstem);
  474. vbuf [wcount++] = (pum == 0) ? POS_AUXVERB : POS_AUXADJ;
  475. return AUX_VERB_VALID;
  476. }
  477. }
  478. if(AUX_ACT_AD == 1)
  479. {
  480. char tstem [80];
  481. Conv.INS2HAN (aux_stem, tstem, codeWanSeong);
  482. if (FindSilsaWord (tstem) & _ADJECTIVE)
  483. {
  484. lstrcat (lrgsz, tstem);
  485. vbuf [wcount++] = POS_ADJECTIVE;
  486. lstrcat (lrgsz, "+");
  487. Conv.INR2HAN (aux_ending, tstem, codeWanSeong);
  488. if (lstrlen (tstem) > 2)
  489. {
  490. int mark = SeparateEnding (aux_ending);
  491. if (mark > 0)
  492. {
  493. char tmpending [80];
  494. lstrcpy (tmpending, aux_ending);
  495. Conv.INR2HAN (tmpending+mark, tstem, codeWanSeong);
  496. lstrcat (lrgsz, tstem);
  497. vbuf [wcount++] = POS_ENDING;
  498. lstrcat (lrgsz, "+");
  499. tmpending [mark] = '\0';
  500. Conv.INR2HAN (tmpending, tstem, codeWanSeong);
  501. }
  502. }
  503. lstrcat (lrgsz, tstem);
  504. vbuf [wcount++] = (pum == 0) ? POS_AUXVERB : POS_AUXADJ;
  505. return AUX_ADJ_VALID;
  506. }
  507. if(NLP_Dap_Proc(aux_stem) == Dap_VALID)
  508. {
  509. char tstem [80];
  510. lstrcat (lrgsz, "+");
  511. Conv.INR2HAN (aux_ending, tstem, codeWanSeong);
  512. if (lstrlen (tstem) > 2)
  513. {
  514. int mark = SeparateEnding (aux_ending);
  515. if (mark > 0)
  516. {
  517. char tmpending [80];
  518. lstrcpy (tmpending, aux_ending);
  519. Conv.INR2HAN (tmpending+mark, tstem, codeWanSeong);
  520. lstrcat (lrgsz, tstem);
  521. vbuf [wcount++] = POS_ENDING;
  522. lstrcat (lrgsz, "+");
  523. tmpending [mark] = '\0';
  524. Conv.INR2HAN (tmpending, tstem, codeWanSeong);
  525. }
  526. }
  527. lstrcat (lrgsz, tstem);
  528. vbuf [wcount++] = (pum == 0) ? POS_AUXVERB : POS_AUXADJ;
  529. return AUX_Dap_VALID;
  530. }
  531. if(NLP_Gop_Proc(aux_stem) == Gop_VALID)
  532. {
  533. char tstem [80];
  534. lstrcat (lrgsz, "+");
  535. Conv.INR2HAN (aux_ending, tstem, codeWanSeong);
  536. if (lstrlen (tstem) > 2)
  537. {
  538. int mark = SeparateEnding (aux_ending);
  539. if (mark > 0)
  540. {
  541. char tmpending [80];
  542. lstrcpy (tmpending, aux_ending);
  543. Conv.INR2HAN (tmpending+mark, tstem, codeWanSeong);
  544. lstrcat (lrgsz, tstem);
  545. vbuf [wcount++] = POS_ENDING;
  546. lstrcat (lrgsz, "+");
  547. tmpending [mark] = '\0';
  548. Conv.INR2HAN (tmpending, tstem, codeWanSeong);
  549. }
  550. }
  551. lstrcat (lrgsz, tstem);
  552. vbuf [wcount++] = (pum == 0) ? POS_AUXVERB : POS_AUXADJ;
  553. return AUX_Gop_VALID;
  554. }
  555. if((reg = NLP_Manha_Proc(aux_stem)) < INVALID)
  556. {
  557. if(reg == Manha_VALID)
  558. {
  559. char tstem [80];
  560. lstrcat (lrgsz, "+");
  561. Conv.INR2HAN (aux_ending, tstem, codeWanSeong);
  562. if (lstrlen (tstem) > 2)
  563. {
  564. int mark = SeparateEnding (aux_ending);
  565. if (mark > 0)
  566. {
  567. char tmpending [80];
  568. lstrcpy (tmpending, aux_ending);
  569. Conv.INR2HAN (tmpending+mark, tstem, codeWanSeong);
  570. lstrcat (lrgsz, tstem);
  571. vbuf [wcount++] = POS_ENDING;
  572. lstrcat (lrgsz, "+");
  573. tmpending [mark] = '\0';
  574. Conv.INR2HAN (tmpending, tstem, codeWanSeong);
  575. }
  576. }
  577. lstrcat (lrgsz, tstem);
  578. vbuf [wcount++] = (pum == 0) ? POS_AUXVERB : POS_AUXADJ;
  579. return AUX_Manha_VALID;
  580. }
  581. if(reg == Yenha_VALID)
  582. {
  583. char tstem [80];
  584. lstrcat (lrgsz, "+");
  585. Conv.INR2HAN (aux_ending, tstem, codeWanSeong);
  586. if (lstrlen (tstem) > 2)
  587. {
  588. int mark = SeparateEnding (aux_ending);
  589. if (mark > 0)
  590. {
  591. char tmpending [80];
  592. lstrcpy (tmpending, aux_ending);
  593. Conv.INR2HAN (tmpending+mark, tstem, codeWanSeong);
  594. lstrcat (lrgsz, tstem);
  595. vbuf [wcount++] = POS_ENDING;
  596. lstrcat (lrgsz, "+");
  597. tmpending [mark] = '\0';
  598. Conv.INR2HAN (tmpending, tstem, codeWanSeong);
  599. }
  600. }
  601. lstrcat (lrgsz, tstem);
  602. vbuf [wcount++] = (pum == 0) ? POS_AUXVERB : POS_AUXADJ;
  603. return AUX_Yenha_VALID;
  604. }
  605. }
  606. if((reg = NLP_Manhaeci_Proc(aux_stem)) == Manhaeci_VALID)
  607. {
  608. char tstem [80];
  609. lstrcat (lrgsz, "+");
  610. Conv.INR2HAN (aux_ending, tstem, codeWanSeong);
  611. if (lstrlen (tstem) > 2)
  612. {
  613. int mark = SeparateEnding (aux_ending);
  614. if (mark > 0)
  615. {
  616. char tmpending [80];
  617. lstrcpy (tmpending, aux_ending);
  618. Conv.INR2HAN (tmpending+mark, tstem, codeWanSeong);
  619. lstrcat (lrgsz, tstem);
  620. vbuf [wcount++] = POS_ENDING;
  621. lstrcat (lrgsz, "+");
  622. tmpending [mark] = '\0';
  623. Conv.INR2HAN (tmpending, tstem, codeWanSeong);
  624. }
  625. }
  626. lstrcat (lrgsz, tstem);
  627. vbuf [wcount++] = (pum == 0) ? POS_AUXVERB : POS_AUXADJ;
  628. return AUX_Manhaeci_VALID;
  629. }
  630. }
  631. }
  632. else if(reg == INVALID)
  633. {
  634. return INVALID;
  635. }
  636. if(AUX_ACT_C == 0 && AUX_ACT_V == 1)
  637. {
  638. if(__IsDefStem(AUXULS, 2) == 1 &&
  639. aux_stem[luls] == __V_n && aux_stem[luls-1] == __K_I)
  640. {
  641. if((reg = NLP_AUX_IRR_01(aux_stem)) == Dap_Proc)
  642. {
  643. temp = luls;
  644. __DelStem1(tmp, &temp);
  645. luls = temp;
  646. __RepStem1(tmp, luls, __K_B);
  647. reg = NLP_Dap_Proc(tmp);
  648. if(reg == Dap_VALID)
  649. {
  650. reg = AUX_Irr_Dap_VALID;
  651. }
  652. }
  653. if(reg != MORECHECK)
  654. {
  655. char tstem [80];
  656. lstrcat (lrgsz, "+");
  657. Conv.INR2HAN (aux_ending, tstem, codeWanSeong);
  658. if (lstrlen (tstem) > 2)
  659. {
  660. int mark = SeparateEnding (aux_ending);
  661. if (mark > 0)
  662. {
  663. char tmpending [80];
  664. lstrcpy (tmpending, aux_ending);
  665. Conv.INR2HAN (tmpending+mark, tstem, codeWanSeong);
  666. lstrcat (lrgsz, tstem);
  667. vbuf [wcount++] = POS_ENDING;
  668. lstrcat (lrgsz, "+");
  669. tmpending [mark] = '\0';
  670. Conv.INR2HAN (tmpending, tstem, codeWanSeong);
  671. }
  672. }
  673. lstrcat (lrgsz, tstem);
  674. vbuf [wcount++] = (pum == 0) ? POS_AUXVERB : POS_AUXADJ;
  675. return reg;
  676. }
  677. }
  678. }
  679. switch (AUXLME)
  680. {
  681. case __K_N :
  682. reg = NLP_AUX_IRR_KN(aux_stem); break;
  683. case __K_R :
  684. reg = NLP_AUX_IRR_KR(aux_stem); break;
  685. case __K_I :
  686. if(AUXULS == __K_R)
  687. {
  688. reg = NLP_AUX_IRR_KI_KR(aux_stem, aux_ending); break;
  689. }
  690. else if(AUXULS >= __V_k)
  691. {
  692. reg = NLP_AUX_IRR_KI_V(aux_stem, aux_ending); break;
  693. }
  694. else
  695. return MORECHECK;
  696. }
  697. if (reg != MORECHECK)
  698. {
  699. char tstem [80];
  700. lstrcat (lrgsz, "+");
  701. Conv.INR2HAN (aux_ending, tstem, codeWanSeong);
  702. if (lstrlen (tstem) > 2)
  703. {
  704. int mark = SeparateEnding (aux_ending);
  705. if (mark > 0)
  706. {
  707. char tmpending [80];
  708. lstrcpy (tmpending, aux_ending);
  709. Conv.INR2HAN (tmpending+mark, tstem, codeWanSeong);
  710. lstrcat (lrgsz, tstem);
  711. vbuf [wcount++] = POS_ENDING;
  712. lstrcat (lrgsz, "+");
  713. tmpending [mark] = '\0';
  714. Conv.INR2HAN (tmpending, tstem, codeWanSeong);
  715. }
  716. }
  717. lstrcat (lrgsz, tstem);
  718. vbuf [wcount++] = (pum == 0) ? POS_AUXVERB : POS_AUXADJ;
  719. return reg;
  720. }
  721. return MORECHECK;
  722. }
  723. //----------------------------------------------------------------------------------------------
  724. //
  725. // Function Name : NLP_GET_AUX()
  726. // Parameters : char *aux_stem :
  727. // char *aux_ending :
  728. // char *dummyl :
  729. // char pum :
  730. // Summary :
  731. // Description :
  732. //
  733. //----------------------------------------------------------------------------------------------
  734. int BaseEngine::NLP_GET_AUX(char *aux_stem,
  735. char *aux_ending,
  736. char pum)
  737. {
  738. BYTE tempaction;
  739. char action,
  740. dummyl[1];
  741. int res,
  742. checked = -1,
  743. aux_pos = 0,
  744. dictnum = (pum == 0) ? 7 : 8,
  745. codelen = lstrlen(aux_stem) - 1;
  746. for (int i = 0; i <= codelen; i++)
  747. {
  748. aux_ending[i] = aux_stem[codelen-i];
  749. aux_ending[i+1] = NULLCHAR;
  750. if (pum == 0)
  751. res = FindHeosaWord(aux_ending, _AUXVERB, &tempaction);
  752. else
  753. res = FindHeosaWord(aux_ending, _AUXADJ, &tempaction);
  754. switch (res)
  755. {
  756. case FINAL :
  757. case FINAL_MORE :
  758. checked = i;
  759. action = tempaction;
  760. continue;
  761. case FALSE_MORE :
  762. continue;
  763. case NOT_FOUND :
  764. break;
  765. }
  766. break;
  767. }
  768. if(checked == -1)
  769. {
  770. return MORECHECK;
  771. }
  772. aux_stem[codelen-checked] = NULLCHAR;
  773. aux_ending[checked+1] = NULLCHAR;
  774. AUX_ULSPOS = codelen-checked-1;
  775. AUX_LMEPOS = checked;
  776. AUX_ACT_C = GetBit(action, 7);
  777. AUX_ACT_V = GetBit(action, 6);
  778. AUX_ACT_VB = GetBit(action, 5);
  779. AUX_ACT_AD = GetBit(action, 4);
  780. AUX_ACT_SS = GetBit(action, 2);
  781. for (int z = 0; z < 7; z++)
  782. {
  783. if(strcmp(aux_ending, ExceptAuxEnding[z]) == 0)
  784. {
  785. aux_pos = -1;
  786. break;
  787. }
  788. }
  789. return lTRUE;
  790. }
  791. //----------------------------------------------------------------------------------------------
  792. //
  793. // Function Name : NLP_AUX_IRR_01()
  794. // Parameters : char *stem :
  795. // Description :
  796. // Return Value :
  797. //
  798. //----------------------------------------------------------------------------------------------
  799. int BaseEngine::NLP_AUX_IRR_01( char *aux_stem)
  800. {
  801. char tmp[80];
  802. int luls, temp;
  803. lstrcpy(tmp, aux_stem);
  804. luls = AUX_ULSPOS;
  805. if(__IsDefStem(luls, 1) == 1 &&
  806. tmp[luls-1] == __K_I && tmp[luls] == __V_n)
  807. {
  808. temp = luls;
  809. __DelStem1(tmp, &temp);
  810. luls = temp;
  811. __RepStem1(tmp, luls, __K_B);
  812. if (FindIrrWord (tmp, _IV_BM) & FINAL)
  813. {
  814. char tstem [80];
  815. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  816. lstrcat (lrgsz, tstem);
  817. vbuf [wcount++] = POS_VERB;
  818. return AUX_Irr_VERB_VALID;
  819. }
  820. if(strcmp(tmp, TempDOP) == 0)
  821. {
  822. char tstem [80];
  823. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  824. lstrcat (lrgsz, tstem);
  825. vbuf [wcount++] = POS_VERB;
  826. return AUX_Irr_VERB_VALID;
  827. }
  828. if(AUX_ACT_AD == 1)
  829. {
  830. if(FindIrrWord (tmp, _RA_B) & FINAL)
  831. {
  832. return INVALID;
  833. }
  834. char tstem [80];
  835. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  836. if (FindSilsaWord (tstem) & _ADJECTIVE)
  837. {
  838. lstrcat (lrgsz, tstem);
  839. vbuf [wcount++] = POS_ADJECTIVE;
  840. return AUX_Irr_ADJ_VALID;
  841. }
  842. return Dap_Proc;
  843. }
  844. }
  845. return MORECHECK;
  846. }
  847. //----------------------------------------------------------------------------------------------
  848. //
  849. // Function Name : NLP_AUX_IRR_KN()
  850. // Parameters : char *stem :
  851. // Description :
  852. // Return Value :
  853. //
  854. //----------------------------------------------------------------------------------------------
  855. int BaseEngine::NLP_AUX_IRR_KN( char *aux_stem)
  856. {
  857. char tmp[80];
  858. int luls, temp;
  859. lstrcpy(tmp, aux_stem);
  860. luls = AUX_ULSPOS;
  861. if(AUX_ACT_C == 1)
  862. {
  863. if(FindIrrWord(tmp, _YOP) & FINAL ||
  864. FindIrrWord (tmp, _ISS) & FINAL)
  865. {
  866. char tstem [80];
  867. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  868. lstrcat (lrgsz, tstem);
  869. vbuf [wcount++] = POS_ADJECTIVE;
  870. return AUX_Irr_ADJ_VALID;
  871. }
  872. }
  873. temp = luls;
  874. __AddStem1(tmp, &temp, __K_R);
  875. luls = temp;
  876. char tstem [80];
  877. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  878. if (FindSilsaWord (tstem) & _VERB)
  879. {
  880. char tstem [80];
  881. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  882. lstrcat (lrgsz, tstem);
  883. vbuf [wcount++] = POS_VERB;
  884. return AUX_Irr_VERB_VALID;
  885. }
  886. if(AUX_ACT_AD == 1)
  887. {
  888. char tstem [80];
  889. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  890. if (FindSilsaWord (tstem) & _ADJECTIVE)
  891. {
  892. lstrcat (lrgsz, tstem);
  893. vbuf [wcount++] = POS_ADJECTIVE;
  894. return AUX_Irr_ADJ_VALID;
  895. }
  896. __RepStem1(tmp, luls, __K_H);
  897. if(FindIrrWord(tmp, _IA_HP) & FINAL ||
  898. FindIrrWord(tmp, _IA_HM) & FINAL)
  899. {
  900. char tstem [80];
  901. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  902. lstrcat (lrgsz, tstem);
  903. vbuf [wcount++] = POS_ADJECTIVE;
  904. return AUX_Irr_ADJ_VALID;
  905. }
  906. }
  907. return MORECHECK;
  908. }
  909. //----------------------------------------------------------------------------------------------
  910. //
  911. // Function Name : NLP_AUX_IRR_KR()
  912. // Parameters : char *stem :
  913. // Description :
  914. // Return Value :
  915. //
  916. //----------------------------------------------------------------------------------------------
  917. int BaseEngine::NLP_AUX_IRR_KR( char *aux_stem)
  918. {
  919. char tmp[80];
  920. int temp, luls;
  921. lstrcpy(tmp, aux_stem);
  922. luls = AUX_ULSPOS;
  923. temp = luls;
  924. __AddStem1(tmp, &temp, __K_R);
  925. luls = temp;
  926. char tstem [80];
  927. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  928. if (FindSilsaWord (tstem) & _VERB)
  929. {
  930. lstrcat (lrgsz, tstem);
  931. vbuf [wcount++] = POS_VERB;
  932. return AUX_Irr_VERB_VALID;
  933. }
  934. if(AUX_ACT_AD == 1)
  935. {
  936. char tstem [80];
  937. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  938. if (FindSilsaWord (tstem) & _ADJECTIVE)
  939. {
  940. lstrcat (lrgsz, tstem);
  941. vbuf [wcount++] = POS_ADJECTIVE;
  942. return AUX_Irr_ADJ_VALID;
  943. }
  944. __RepStem1(tmp, luls, __K_H);
  945. if(FindIrrWord(tmp, _IA_HP) & FINAL ||
  946. FindIrrWord(tmp, _IA_HM) & FINAL)
  947. {
  948. char tstem [80];
  949. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  950. lstrcat (lrgsz, tstem);
  951. vbuf [wcount++] = POS_ADJECTIVE;
  952. return AUX_Irr_ADJ_VALID;
  953. }
  954. }
  955. return MORECHECK;
  956. }
  957. //----------------------------------------------------------------------------------------------
  958. //
  959. // Function Name : NLP_AUX_IRR_KI_KR()
  960. // Parameters : char *stem :
  961. // Description :
  962. // Return Value :
  963. //
  964. //----------------------------------------------------------------------------------------------
  965. int BaseEngine::NLP_AUX_IRR_KI_KR( char *aux_stem,
  966. char *aux_ending)
  967. {
  968. char end[80],
  969. tmp[80];
  970. int luls, llme;
  971. lstrcpy(tmp, aux_stem);
  972. lstrcpy(end, aux_ending);
  973. luls = AUX_ULSPOS;
  974. llme = AUX_LMEPOS;
  975. __RepStem1(tmp, luls, __K_D);
  976. if(end[llme-1] == __V_j)
  977. {
  978. if(FindIrrWord(tmp, _IV_DM) & FINAL) //v2-
  979. {
  980. char tstem [80];
  981. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  982. lstrcat (lrgsz, tstem);
  983. vbuf [wcount++] = POS_VERB;
  984. return AUX_Irr_VERB_VALID;
  985. }
  986. return MORECHECK;
  987. }
  988. if(end[llme-1] == __V_k)
  989. {
  990. if(FindIrrWord(tmp, _IV_DP) & FINAL) //v2+
  991. {
  992. char tstem [80];
  993. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  994. lstrcat (lrgsz, tstem);
  995. vbuf [wcount++] = POS_VERB;
  996. return AUX_Irr_VERB_VALID;
  997. }
  998. return MORECHECK;
  999. }
  1000. if(FindIrrWord(tmp, _IV_DP) & FINAL || //v2+
  1001. FindIrrWord(tmp, _IV_DM) & FINAL) //v2-
  1002. {
  1003. char tstem [80];
  1004. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1005. lstrcat (lrgsz, tstem);
  1006. vbuf [wcount++] = POS_VERB;
  1007. return AUX_Irr_VERB_VALID;
  1008. }
  1009. return MORECHECK;
  1010. }
  1011. //----------------------------------------------------------------------------------------------
  1012. //
  1013. // Function Name : NLP_AUX_IRR_KI_V()
  1014. // Parameters : char *stem :
  1015. // Description :
  1016. // Return Value :
  1017. //
  1018. //----------------------------------------------------------------------------------------------
  1019. int BaseEngine::NLP_AUX_IRR_KI_V( char *aux_stem,
  1020. char *aux_ending)
  1021. {
  1022. char end[80],
  1023. tmp[80];
  1024. int temp, luls, llme;
  1025. lstrcpy(tmp, aux_stem);
  1026. lstrcpy(end, aux_ending);
  1027. luls = AUX_ULSPOS;
  1028. llme = AUX_LMEPOS;
  1029. temp = luls;
  1030. __AddStem1(tmp, &temp, __K_S);
  1031. luls = temp;
  1032. if(end[llme-1] == __V_j)
  1033. {
  1034. if(FindIrrWord(tmp, _IV_SM) & FINAL) //v4-
  1035. {
  1036. char tstem [80];
  1037. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1038. lstrcat (lrgsz, tstem);
  1039. vbuf [wcount++] = POS_VERB;
  1040. return AUX_Irr_VERB_VALID;
  1041. }
  1042. return MORECHECK;
  1043. }
  1044. if(end[llme-1] == __V_k)
  1045. {
  1046. if(FindIrrWord(tmp, _IV_SP) & FINAL) //v4+
  1047. {
  1048. char tstem [80];
  1049. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1050. lstrcat (lrgsz, tstem);
  1051. vbuf [wcount++] = POS_VERB;
  1052. return AUX_Irr_VERB_VALID;
  1053. }
  1054. temp = luls;
  1055. __DelStem1(tmp, &temp);
  1056. __AddStem2(tmp, &temp, __K_I, __V_m);
  1057. luls = temp;
  1058. if(FindIrrWord(tmp, _IV_OmP) & FINAL) //v8+
  1059. {
  1060. char tstem [80];
  1061. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1062. lstrcat (lrgsz, tstem);
  1063. vbuf [wcount++] = POS_VERB;
  1064. return AUX_Irr_VERB_VALID;
  1065. }
  1066. return MORECHECK;
  1067. }
  1068. if(FindIrrWord(tmp, _IV_SP) & FINAL || //v4+
  1069. FindIrrWord(tmp, _IV_SM) & FINAL) //v4-
  1070. {
  1071. char tstem [80];
  1072. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1073. lstrcat (lrgsz, tstem);
  1074. vbuf [wcount++] = POS_VERB;
  1075. return AUX_Irr_VERB_VALID;
  1076. }
  1077. return MORECHECK;
  1078. }
  1079. //----------------------------------------------------------------------------------------------
  1080. //
  1081. // Function Name : NLP_AUX_SS_Vu()
  1082. // Parameters : char *stem :
  1083. // Description :
  1084. // Return Value :
  1085. //
  1086. //----------------------------------------------------------------------------------------------
  1087. int BaseEngine::NLP_AUX_SS_Vu( char *aux_stem)
  1088. {
  1089. char tmp[80];
  1090. int temp, luls;
  1091. lstrcpy(tmp, aux_stem);
  1092. luls = AUX_ULSPOS;
  1093. if(__IsDefStem(luls, 1) == 1 && tmp[luls-1] == __K_I)
  1094. {
  1095. if(__IsDefStem(luls, 3) == 1 &&
  1096. tmp[luls-3] == __K_H && tmp[luls-2] == __V_k )
  1097. {
  1098. temp = luls;
  1099. __DelStem2(tmp, &temp);
  1100. luls = temp;
  1101. if(AUX_ACT_VB == 1)
  1102. {
  1103. char tstem [80];
  1104. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1105. if (FindSilsaWord (tstem) & _VERB)
  1106. {
  1107. lstrcat (lrgsz, tstem);
  1108. vbuf [wcount++] = POS_VERB;
  1109. return AUX_SS_VERB_VALID;
  1110. }
  1111. }
  1112. if(AUX_ACT_AD == 1)
  1113. {
  1114. char tstem [80];
  1115. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1116. if (FindSilsaWord (tstem) & _ADJECTIVE)
  1117. {
  1118. lstrcat (lrgsz, tstem);
  1119. vbuf [wcount++] = POS_ADJECTIVE;
  1120. return AUX_SS_ADJ_VALID;
  1121. }
  1122. }
  1123. return Manha_Proc;
  1124. }
  1125. }
  1126. if(AUX_ACT_VB == 1)
  1127. {
  1128. if(FindIrrWord(tmp, _ZUV_YO) & FINAL)
  1129. {
  1130. char tstem [80];
  1131. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1132. lstrcat (lrgsz, tstem);
  1133. vbuf [wcount++] = POS_VERB;
  1134. return AUX_SS_VERB_VALID;
  1135. }
  1136. }
  1137. __RepStem1(tmp, luls, __V_l);
  1138. if(AUX_ACT_VB == 1)
  1139. {
  1140. char tstem [80];
  1141. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1142. if (FindSilsaWord (tstem) & _VERB)
  1143. {
  1144. lstrcat (lrgsz, tstem);
  1145. vbuf [wcount++] = POS_VERB;
  1146. return AUX_SS_VERB_VALID;
  1147. }
  1148. }
  1149. if(AUX_ACT_AD == 1)
  1150. {
  1151. char tstem [80];
  1152. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1153. if (FindSilsaWord (tstem) & _ADJECTIVE)
  1154. {
  1155. lstrcat (lrgsz, tstem);
  1156. vbuf [wcount++] = POS_ADJECTIVE;
  1157. return AUX_SS_ADJ_VALID;
  1158. }
  1159. }
  1160. return Manhaeci_Proc;
  1161. }
  1162. //----------------------------------------------------------------------------------------------
  1163. //
  1164. // Function Name : NLP_AUX_SS_Vnj()
  1165. // Parameters : char *stem :
  1166. // Description :
  1167. // Return Value :
  1168. //
  1169. //----------------------------------------------------------------------------------------------
  1170. int BaseEngine::NLP_AUX_SS_Vnj( char *aux_stem)
  1171. {
  1172. char tmp[80];
  1173. int temp, luls;
  1174. lstrcpy(tmp, aux_stem);
  1175. luls = AUX_ULSPOS;
  1176. __RepStem1(tmp, luls, __V_n);
  1177. if(AUX_ACT_VB == 1)
  1178. {
  1179. char tstem [80];
  1180. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1181. if (FindSilsaWord (tstem) & _VERB)
  1182. {
  1183. lstrcat (lrgsz, tstem);
  1184. vbuf [wcount++] = POS_VERB;
  1185. return AUX_SS_VERB_VALID;
  1186. }
  1187. }
  1188. if(__IsDefStem(luls, 1) == 1 && tmp[luls-1] == __K_I)
  1189. {
  1190. temp = luls;
  1191. __DelStem1(tmp, &temp);
  1192. luls = temp;
  1193. __RepStem1(tmp, luls, __K_B);
  1194. if(AUX_ACT_VB == 1)
  1195. {
  1196. if(FindIrrWord(tmp, _IV_BM) & FINAL)
  1197. {
  1198. char tstem [80];
  1199. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1200. lstrcat (lrgsz, tstem);
  1201. vbuf [wcount++] = POS_VERB;
  1202. return AUX_SS_VERB_VALID;
  1203. }
  1204. }
  1205. if(AUX_ACT_AD == 1)
  1206. {
  1207. if(FindIrrWord(tmp, _RA_B) & FINAL)
  1208. {
  1209. return INVALID;
  1210. }
  1211. if(FindIrrWord(tmp, _IA_BP) & FINAL)
  1212. {
  1213. return INVALID;
  1214. }
  1215. char tstem [80];
  1216. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1217. if (FindSilsaWord (tstem) & _ADJECTIVE)
  1218. {
  1219. lstrcat (lrgsz, tstem);
  1220. vbuf [wcount++] = POS_ADJECTIVE;
  1221. return AUX_SS_ADJ_VALID;
  1222. }
  1223. return Dap_Proc;
  1224. }
  1225. }
  1226. return MORECHECK;
  1227. }
  1228. //----------------------------------------------------------------------------------------------
  1229. //
  1230. // Function Name : NLP_AUX_SS_Vhk()
  1231. // Parameters : char *stem :
  1232. // Description :
  1233. // Return Value :
  1234. //
  1235. //----------------------------------------------------------------------------------------------
  1236. int BaseEngine::NLP_AUX_SS_Vhk( char *aux_stem)
  1237. {
  1238. char tmp[80];
  1239. int temp, luls;
  1240. lstrcpy(tmp, aux_stem);
  1241. luls = AUX_ULSPOS;
  1242. __RepStem1(tmp, luls, __V_h);
  1243. if(AUX_ACT_VB == 1)
  1244. {
  1245. char tstem [80];
  1246. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1247. if (FindSilsaWord (tstem) & _VERB)
  1248. {
  1249. lstrcat (lrgsz, tstem);
  1250. vbuf [wcount++] = POS_VERB;
  1251. return AUX_SS_VERB_VALID;
  1252. }
  1253. }
  1254. if(__IsDefStem(luls, 1) == 1 && tmp[luls-1] == __K_I)
  1255. {
  1256. temp = luls;
  1257. __DelStem1(tmp, &temp);
  1258. luls = temp;
  1259. __RepStem1(tmp, luls, __K_B);
  1260. if(AUX_ACT_VB == 1)
  1261. {
  1262. if(FindIrrWord(tmp, _IV_BP) & FINAL)
  1263. {
  1264. char tstem [80];
  1265. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1266. lstrcat (lrgsz, tstem);
  1267. vbuf [wcount++] = POS_VERB;
  1268. return AUX_SS_VERB_VALID;
  1269. }
  1270. }
  1271. if(AUX_ACT_AD == 1)
  1272. {
  1273. if(FindIrrWord(tmp, _IA_BP) & FINAL)
  1274. {
  1275. char tstem [80];
  1276. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1277. lstrcat (lrgsz, tstem);
  1278. vbuf [wcount++] = POS_ADJECTIVE;
  1279. return AUX_SS_ADJ_VALID;
  1280. }
  1281. }
  1282. }
  1283. return MORECHECK;
  1284. }
  1285. //----------------------------------------------------------------------------------------------
  1286. //
  1287. // Function Name : NLP_AUX_SS_Vo()
  1288. // Parameters : char *stem :
  1289. // Description :
  1290. // Return Value :
  1291. //
  1292. //----------------------------------------------------------------------------------------------
  1293. int BaseEngine::NLP_AUX_SS_Vo( char *aux_stem)
  1294. {
  1295. char tmp[80];
  1296. int temp, luls;
  1297. lstrcpy(tmp, aux_stem);
  1298. luls = AUX_ULSPOS;
  1299. if(__IsDefStem(luls, 1) == 1 && tmp[luls-1] == __K_H)
  1300. {
  1301. __RepStem1(tmp, luls, __V_k);
  1302. if(AUX_ACT_VB == 1)
  1303. {
  1304. char tstem [80];
  1305. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1306. if (FindSilsaWord (tstem) & _VERB)
  1307. {
  1308. lstrcat (lrgsz, tstem);
  1309. vbuf [wcount++] = POS_VERB;
  1310. return AUX_SS_VERB_VALID;
  1311. }
  1312. }
  1313. if(AUX_ACT_AD == 1)
  1314. {
  1315. char tstem [80];
  1316. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1317. if (FindSilsaWord (tstem) & _ADJECTIVE)
  1318. {
  1319. lstrcat (lrgsz, tstem);
  1320. vbuf [wcount++] = POS_ADJECTIVE;
  1321. return AUX_SS_ADJ_VALID;
  1322. }
  1323. }
  1324. return Manha_Proc;
  1325. }
  1326. if(AUX_ACT_VB == 1)
  1327. {
  1328. char tstem [80];
  1329. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1330. if (FindSilsaWord (tstem) & _VERB)
  1331. {
  1332. lstrcat (lrgsz, tstem);
  1333. vbuf [wcount++] = POS_VERB;
  1334. return AUX_SS_VERB_VALID;
  1335. }
  1336. }
  1337. if(AUX_ACT_AD == 1)
  1338. {
  1339. if(FindIrrWord(tmp, _ZUA_AE) & FINAL)
  1340. {
  1341. char tstem [80];
  1342. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1343. lstrcat (lrgsz, tstem);
  1344. vbuf [wcount++] = POS_ADJECTIVE;
  1345. return AUX_SS_ADJ_VALID;
  1346. }
  1347. __RepStem1(tmp, luls, __V_k);
  1348. temp = luls;
  1349. __AddStem1(tmp, &temp, __K_H);
  1350. luls = temp;
  1351. if(FindIrrWord(tmp, _IA_HP) & FINAL)
  1352. {
  1353. char tstem [80];
  1354. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1355. lstrcat (lrgsz, tstem);
  1356. vbuf [wcount++] = POS_ADJECTIVE;
  1357. return AUX_SS_ADJ_VALID;
  1358. }
  1359. __RepStem2(tmp, luls, __V_j, __K_H);
  1360. if(FindIrrWord(tmp, _IA_HM) & FINAL)
  1361. {
  1362. char tstem [80];
  1363. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1364. lstrcat (lrgsz, tstem);
  1365. vbuf [wcount++] = POS_ADJECTIVE;
  1366. return AUX_SS_ADJ_VALID;
  1367. }
  1368. }
  1369. return MORECHECK;
  1370. }
  1371. //----------------------------------------------------------------------------------------------
  1372. //
  1373. // Function Name : NLP_AUX_SS_Vp()
  1374. // Parameters : char *stem :
  1375. // Description :
  1376. // Return Value :
  1377. //
  1378. //----------------------------------------------------------------------------------------------
  1379. int BaseEngine::NLP_AUX_SS_Vp( char *aux_stem)
  1380. {
  1381. char tmp[80];
  1382. int luls, temp;
  1383. lstrcpy(tmp, aux_stem);
  1384. luls = AUX_ULSPOS;
  1385. if(AUX_ACT_VB == 1)
  1386. {
  1387. if(FindIrrWord(tmp, _ZUV_E) & FINAL)
  1388. {
  1389. char tstem [80];
  1390. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1391. lstrcat (lrgsz, tstem);
  1392. vbuf [wcount++] = POS_VERB;
  1393. return AUX_SS_VERB_VALID;
  1394. }
  1395. }
  1396. if(AUX_ACT_AD == 1)
  1397. {
  1398. if(FindIrrWord(tmp, _ZUA_E) & FINAL)
  1399. {
  1400. char tstem [80];
  1401. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1402. lstrcat (lrgsz, tstem);
  1403. vbuf [wcount++] = POS_ADJECTIVE;
  1404. return AUX_SS_ADJ_VALID;
  1405. }
  1406. __RepStem1(tmp, luls, __V_j);
  1407. temp = luls;
  1408. __AddStem1(tmp, &temp, __K_H);
  1409. luls = temp;
  1410. if(FindIrrWord(tmp, _IA_HM) & FINAL)
  1411. {
  1412. char tstem [80];
  1413. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1414. lstrcat (lrgsz, tstem);
  1415. vbuf [wcount++] = POS_ADJECTIVE;
  1416. return AUX_SS_ADJ_VALID;
  1417. }
  1418. }
  1419. return MORECHECK;
  1420. }
  1421. //----------------------------------------------------------------------------------------------
  1422. //
  1423. // Function Name : NLP_AUX_SS_Vil()
  1424. // Parameters : char *stem :
  1425. // Description :
  1426. // Return Value :
  1427. //
  1428. //----------------------------------------------------------------------------------------------
  1429. int BaseEngine::NLP_AUX_SS_Vil( char *aux_stem)
  1430. {
  1431. char tmp[80];
  1432. int temp, luls;
  1433. lstrcpy(tmp, aux_stem);
  1434. luls = AUX_ULSPOS;
  1435. if(AUX_ACT_AD == 1 &&
  1436. __IsDefStem(luls, 1) == 1 && tmp[luls-1] == __K_I)
  1437. {
  1438. __RepStem1(tmp, luls, __V_i);
  1439. temp = luls;
  1440. __AddStem1(tmp, &temp, __K_H);
  1441. luls = temp;
  1442. if(FindIrrWord(tmp, _IA_HP) & FINAL)
  1443. {
  1444. char tstem [80];
  1445. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1446. lstrcat (lrgsz, tstem);
  1447. vbuf [wcount++] = POS_ADJECTIVE;
  1448. return AUX_SS_ADJ_VALID;
  1449. }
  1450. __RepStem2(tmp, luls, __V_u, __K_H);
  1451. if(FindIrrWord(tmp, _IA_HM) & FINAL)
  1452. {
  1453. char tstem [80];
  1454. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1455. lstrcat (lrgsz, tstem);
  1456. vbuf [wcount++] = POS_ADJECTIVE;
  1457. return AUX_SS_ADJ_VALID;
  1458. }
  1459. }
  1460. return MORECHECK;
  1461. }
  1462. //----------------------------------------------------------------------------------------------
  1463. //
  1464. // Function Name : NLP_AUX_SS_Vul()
  1465. // Parameters : char *stem :
  1466. // Description :
  1467. // Return Value :
  1468. //
  1469. //----------------------------------------------------------------------------------------------
  1470. int BaseEngine::NLP_AUX_SS_Vul( char *aux_stem)
  1471. {
  1472. char tmp[80];
  1473. int temp, luls;
  1474. lstrcpy(tmp, aux_stem);
  1475. luls = AUX_ULSPOS;
  1476. if(AUX_ACT_AD == 1 &&
  1477. __IsDefStem(luls, 1) == 1 && tmp[luls-1] == __K_I)
  1478. {
  1479. __RepStem1(tmp, luls, __V_u);
  1480. temp = luls;
  1481. __AddStem1(tmp, &temp, __K_H);
  1482. luls = temp;
  1483. if(FindIrrWord(tmp, _IA_HM) & FINAL)
  1484. {
  1485. char tstem [80];
  1486. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1487. lstrcat (lrgsz, tstem);
  1488. vbuf [wcount++] = POS_ADJECTIVE;
  1489. return AUX_SS_ADJ_VALID;
  1490. }
  1491. }
  1492. return MORECHECK;
  1493. }
  1494. //----------------------------------------------------------------------------------------------
  1495. //
  1496. // Function Name : NLP_AUX_SS_Vj_KR()
  1497. // Parameters : char *stem :
  1498. // Description :
  1499. // Return Value :
  1500. //
  1501. //----------------------------------------------------------------------------------------------
  1502. int BaseEngine::NLP_AUX_SS_Vj_KR( char *aux_stem)
  1503. {
  1504. char tmp[80];
  1505. int temp, luls;
  1506. lstrcpy(tmp, aux_stem);
  1507. luls = AUX_ULSPOS;
  1508. temp = luls;
  1509. __DelStem2(tmp, &temp);
  1510. luls = temp;
  1511. if(__IsDefStem(luls, 1) == 1 &&
  1512. tmp[luls-1] == __K_R && tmp[luls]==__V_m)
  1513. {
  1514. if(strcmp(tmp, TempR) == 0)
  1515. {
  1516. char tstem [80];
  1517. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1518. lstrcat (lrgsz, tstem);
  1519. vbuf [wcount++] = POS_VERB;
  1520. return AUX_SS_VERB_VALID;
  1521. }
  1522. if(AUX_ACT_AD == 1)
  1523. {
  1524. if(FindIrrWord(tmp, _IA_Rj) & FINAL)
  1525. {
  1526. char tstem [80];
  1527. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1528. lstrcat (lrgsz, tstem);
  1529. vbuf [wcount++] = POS_ADJECTIVE;
  1530. return AUX_SS_ADJ_VALID;
  1531. }
  1532. }
  1533. return MORECHECK;
  1534. }
  1535. if(tmp[luls] == __K_R)
  1536. {
  1537. temp = luls;
  1538. __AddStem1(tmp, &temp, __V_m);
  1539. luls = temp;
  1540. if(AUX_ACT_VB == 1)
  1541. {
  1542. if(FindIrrWord(tmp, _IV_RmM) & FINAL)
  1543. {
  1544. char tstem [80];
  1545. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1546. lstrcat (lrgsz, tstem);
  1547. vbuf [wcount++] = POS_VERB;
  1548. return AUX_SS_VERB_VALID;
  1549. }
  1550. }
  1551. if(AUX_ACT_AD == 1)
  1552. {
  1553. if(FindIrrWord(tmp, _IA_RmM) & FINAL)
  1554. {
  1555. char tstem [80];
  1556. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1557. lstrcat (lrgsz, tstem);
  1558. vbuf [wcount++] = POS_ADJECTIVE;
  1559. return AUX_SS_ADJ_VALID;
  1560. }
  1561. }
  1562. temp = luls;
  1563. __DelStem2(tmp, &temp);
  1564. __AddStem1(tmp, &temp, __K_R);
  1565. __AddStem2(tmp, &temp, __K_R, __V_m);
  1566. luls = temp;
  1567. if(FindIrrWord(tmp, _IV_OmM) & FINAL)
  1568. {
  1569. char tstem [80];
  1570. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1571. lstrcat (lrgsz, tstem);
  1572. vbuf [wcount++] = POS_VERB;
  1573. return AUX_SS_VERB_VALID;
  1574. }
  1575. return MORECHECK;
  1576. }
  1577. temp = luls;
  1578. __AddStem2(tmp, &temp, __K_R, __V_m);
  1579. luls = temp;
  1580. if(AUX_ACT_VB == 1)
  1581. {
  1582. if(FindIrrWord(tmp, _IV_OmM) & FINAL)
  1583. {
  1584. char tstem [80];
  1585. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1586. lstrcat (lrgsz, tstem);
  1587. vbuf [wcount++] = POS_VERB;
  1588. return AUX_SS_VERB_VALID;
  1589. }
  1590. }
  1591. return MORECHECK;
  1592. }
  1593. //----------------------------------------------------------------------------------------------
  1594. //
  1595. // Function Name : NLP_AUX_SS_Vj()
  1596. // Parameters : char *stem :
  1597. // Call Functions :
  1598. // Description :
  1599. // Return Value :
  1600. //
  1601. //----------------------------------------------------------------------------------------------
  1602. int BaseEngine::NLP_AUX_SS_Vj( char *aux_stem)
  1603. {
  1604. char tmp[80];
  1605. int luls;
  1606. lstrcpy(tmp, aux_stem);
  1607. luls = AUX_ULSPOS;
  1608. if(AUX_ACT_VB == 1)
  1609. {
  1610. if(strcmp(tmp, TempP) == 0) // PEO
  1611. {
  1612. __RepStem1(tmp,luls,__V_n);
  1613. char tstem [80];
  1614. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1615. lstrcat (lrgsz, tstem);
  1616. vbuf [wcount++] = POS_VERB;
  1617. return AUX_SS_VERB_VALID;
  1618. }
  1619. else if (FindIrrWord(tmp, _ZUV_O) & FINAL)
  1620. {
  1621. char tstem [80];
  1622. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1623. lstrcat (lrgsz, tstem);
  1624. vbuf [wcount++] = POS_VERB;
  1625. return AUX_SS_VERB_VALID;
  1626. }
  1627. }
  1628. __RepStem1(tmp, luls, __V_m);
  1629. if(AUX_ACT_VB == 1)
  1630. {
  1631. if(FindIrrWord(tmp, _IV_OmM) & FINAL)
  1632. {
  1633. char tstem [80];
  1634. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1635. lstrcat (lrgsz, tstem);
  1636. vbuf [wcount++] = POS_VERB;
  1637. return AUX_SS_VERB_VALID;
  1638. }
  1639. }
  1640. if(AUX_ACT_AD == 1)
  1641. {
  1642. if(FindIrrWord(tmp, _IA_OmM) & FINAL)
  1643. {
  1644. char tstem [80];
  1645. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1646. lstrcat (lrgsz, tstem);
  1647. vbuf [wcount++] = POS_ADJECTIVE;
  1648. return AUX_SS_ADJ_VALID;
  1649. }
  1650. }
  1651. return MORECHECK;
  1652. }
  1653. //----------------------------------------------------------------------------------------------
  1654. //
  1655. // Function Name : NLP_AUX_SS_Vk()
  1656. // Parameters : char *stem :
  1657. // Call Functions :
  1658. // Description :
  1659. // Return Value :
  1660. //
  1661. //----------------------------------------------------------------------------------------------
  1662. int BaseEngine::NLP_AUX_SS_Vk( char *aux_stem)
  1663. {
  1664. char tmp[80];
  1665. int luls, temp;
  1666. lstrcpy(tmp, aux_stem);
  1667. luls = AUX_ULSPOS;
  1668. if(__IsDefStem(luls, 1) == 1 && tmp[luls-1] == __K_H)
  1669. {
  1670. return MORECHECK; // by hjw : 95/3/14 INVALID -> MORECHECK
  1671. }
  1672. if(AUX_ACT_VB == 1)
  1673. {
  1674. if(FindIrrWord(tmp, _ZUV_A) & FINAL)
  1675. {
  1676. char tstem [80];
  1677. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1678. lstrcat (lrgsz, tstem);
  1679. vbuf [wcount++] = POS_VERB;
  1680. return AUX_SS_VERB_VALID;
  1681. }
  1682. }
  1683. if(AUX_ACT_AD == 1)
  1684. {
  1685. if(FindIrrWord(tmp, _ZUA_A) & FINAL)
  1686. {
  1687. char tstem [80];
  1688. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1689. lstrcat (lrgsz, tstem);
  1690. vbuf [wcount++] = POS_ADJECTIVE;
  1691. return AUX_SS_ADJ_VALID;
  1692. }
  1693. }
  1694. if(__IsDefStem(luls, 1) == 1 && tmp[luls-1] == __K_R)
  1695. {
  1696. if(__IsDefStem(luls, 2) == 1 && tmp[luls-2] == __K_R)
  1697. {
  1698. temp = luls;
  1699. __DelStem2(tmp, &temp);
  1700. __AddStem1(tmp, &temp, __V_m);
  1701. luls = temp;
  1702. if(AUX_ACT_VB == 1)
  1703. {
  1704. if(FindIrrWord(tmp, _IV_RmP) & FINAL)
  1705. {
  1706. char tstem [80];
  1707. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1708. lstrcat (lrgsz, tstem);
  1709. vbuf [wcount++] = POS_VERB;
  1710. return AUX_SS_VERB_VALID;
  1711. }
  1712. }
  1713. if(AUX_ACT_AD == 1)
  1714. {
  1715. if(FindIrrWord(tmp, _IA_RmP) & FINAL)
  1716. {
  1717. char tstem [80];
  1718. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1719. lstrcat (lrgsz, tstem);
  1720. vbuf [wcount++] = POS_ADJECTIVE;
  1721. return AUX_SS_ADJ_VALID;
  1722. }
  1723. }
  1724. return MORECHECK;
  1725. }
  1726. }
  1727. __RepStem1(aux_stem, AUX_ULSPOS, __V_m);
  1728. if(AUX_ACT_VB == 1)
  1729. {
  1730. if(FindIrrWord(tmp, _IV_OmP) & FINAL)
  1731. {
  1732. char tstem [80];
  1733. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1734. lstrcat (lrgsz, tstem);
  1735. vbuf [wcount++] = POS_VERB;
  1736. return AUX_SS_VERB_VALID;
  1737. }
  1738. }
  1739. if(AUX_ACT_AD == 1)
  1740. {
  1741. if(FindIrrWord(tmp, _IA_OmP) & FINAL)
  1742. {
  1743. char tstem [80];
  1744. Conv.INS2HAN (tmp, tstem, codeWanSeong);
  1745. lstrcat (lrgsz, tstem);
  1746. vbuf [wcount++] = POS_VERB;
  1747. return AUX_SS_ADJ_VALID;
  1748. }
  1749. }
  1750. return MORECHECK;
  1751. }