Toggle navigation
Toggle navigation
This project
Loading...
Sign in
윤창신
/
searchGuide
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김서영
2019-11-23 15:12:31 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
490174386862781b20efaab47c09b26b7fb15c58
49017438
1 parent
6c320e51
divide morp by mean - check needmorp and notneedmorp
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
api/textAnalystic.js
api/textAnalystic.js
View file @
4901743
const
apiRequest
=
require
(
'./apiRequest'
);
/**
* @param {{lemma:string, position:number, type:string}[][]} tempMorps - 공백 단위로 묶어둠 ex) [[{감기}],[{걸리},{었},{을}],[{때}]]
* @returns {{needMorp : {}[][], noNeedMorp : {}[][]}} morp를 needMorp와 noNeedMorp로 나눴습니다.
* @description 공백 단위로 나뉜 morp를 받아 type과 의미에 따라 2가지로 분류합니다.
*/
const
divideMorpbyMean
=
(
tempMorps
)
=>
{
let
needMorp
=
[],
noNeedMorp
=
[];
tempMorps
.
forEach
(
(
word
,
j
)
=>
{
if
(
word
[
0
].
type
===
"VV"
||
word
[
0
].
type
===
"VA"
||
word
[
0
].
type
===
"MAG"
)
{
// 동사, 형용사, 부사
let
checkV
=
true
word
.
find
(
(
Morp
)
=>
{
if
(
Morp
.
type
===
"EF"
)
{
// 종결어미
checkV
=
false
;
}
else
if
(
Morp
.
type
===
"EC"
)
{
// 연결어미
if
(
tempMorps
.
length
>
j
+
1
)
{
tempMorps
[
j
+
1
].
forEach
(
(
morp
)
=>
{
if
(
allowMorpChecklist
.
indexOf
(
morp
.
type
)
===
-
1
)
{
checkV
=
false
;
}
});
}
}
});
}
else
{
checkMorp
(
word
,
needMorp
,
noNeedMorp
);
}
});
return
[
needMorp
,
noNeedMorp
];
}
/**
* 수정중...
* @param {String} result - 결과 담던거
* @param {{NE : {}[], Morp : {}[]}} analysisResult 분석 결과가 담겼습니다.
...
...
Please
register
or
login
to post a comment