Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
maca
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Analysers
maca
Commits
c0d84a91
Commit
c0d84a91
authored
Aug 18, 2014
by
Radosław Warzocha
Browse files
Options
Downloads
Patches
Plain Diff
New morfeusz2 API adjustments
parent
bef0195b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
libmaca/morph/morfeusz2analyser.cpp
+10
-9
10 additions, 9 deletions
libmaca/morph/morfeusz2analyser.cpp
libmaca/morph/morfeusz2analyser.h
+2
-1
2 additions, 1 deletion
libmaca/morph/morfeusz2analyser.h
with
12 additions
and
10 deletions
libmaca/morph/morfeusz2analyser.cpp
+
10
−
9
View file @
c0d84a91
...
@@ -83,12 +83,12 @@ bool Morfeusz2Analyser::process_functional(const Toki::Token &t,
...
@@ -83,12 +83,12 @@ bool Morfeusz2Analyser::process_functional(const Toki::Token &t,
std
::
string
s
=
PwrNlp
::
to_utf8
(
t
.
orth
());
std
::
string
s
=
PwrNlp
::
to_utf8
(
t
.
orth
());
std
::
vector
<
details
::
Morfeusz2Edge
>
pmorf
;
std
::
vector
<
details
::
Morfeusz2Edge
>
pmorf
;
Morfeusz
*
morf
=
Morfeusz
::
createInstance
();
Morfeusz
*
morf
=
Morfeusz
::
createInstance
(
ANALYSE_ONLY
);
morf
->
setCharset
(
charset
);
morf
->
setCharset
(
charset
);
ResultsIterator
*
res_iter
=
morf
->
analy
z
e
(
s
);
ResultsIterator
*
res_iter
=
morf
->
analy
s
e
(
s
);
while
(
res_iter
->
hasNext
())
while
(
res_iter
->
hasNext
())
pmorf
.
push_back
(
details
::
Morfeusz2Edge
(
res_iter
->
next
()));
pmorf
.
push_back
(
details
::
Morfeusz2Edge
(
res_iter
->
next
()
,
morf
));
if
(
pmorf
.
size
()
==
1
&&
pmorf
[
0
].
lemma
.
length
()
>
0
)
{
// only one analysis
if
(
pmorf
.
size
()
==
1
&&
pmorf
[
0
].
lemma
.
length
()
>
0
)
{
// only one analysis
Corpus2
::
Token
*
tok
=
make_token
(
t
,
pmorf
[
0
]);
Corpus2
::
Token
*
tok
=
make_token
(
t
,
pmorf
[
0
]);
...
@@ -261,11 +261,12 @@ std::string Morfeusz2Error::info() const
...
@@ -261,11 +261,12 @@ std::string Morfeusz2Error::info() const
}
}
namespace
details
{
namespace
details
{
Morfeusz2Edge
::
Morfeusz2Edge
(
const
morfeusz
::
MorphInterpretation
&
morf
)
Morfeusz2Edge
::
Morfeusz2Edge
(
const
morfeusz
::
MorphInterpretation
interp
,
:
node_from
(
morf
.
getStartNode
()),
node_to
(
morf
.
getEndNode
())
const
morfeusz
::
Morfeusz
*
morf
)
,
orth
(
UnicodeString
::
fromUTF8
(
morf
.
getOrth
()))
:
node_from
(
interp
.
startNode
),
node_to
(
interp
.
endNode
)
,
lemma
(
UnicodeString
::
fromUTF8
(
morf
.
getLemma
()))
,
orth
(
UnicodeString
::
fromUTF8
(
interp
.
orth
))
,
tag_string
(
morf
.
getTag
()),
token
(
NULL
)
,
lemma
(
UnicodeString
::
fromUTF8
(
interp
.
lemma
))
,
tag_string
(
morf
->
getIdResolver
().
getTag
(
interp
.
tagId
)),
token
(
NULL
)
{
{
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
libmaca/morph/morfeusz2analyser.h
+
2
−
1
View file @
c0d84a91
...
@@ -137,7 +137,8 @@ namespace details {
...
@@ -137,7 +137,8 @@ namespace details {
/// Helper struct for holding preprocessed Morfeusz results
/// Helper struct for holding preprocessed Morfeusz results
struct
Morfeusz2Edge
struct
Morfeusz2Edge
{
{
explicit
Morfeusz2Edge
(
const
morfeusz
::
MorphInterpretation
&
morf
);
explicit
Morfeusz2Edge
(
const
morfeusz
::
MorphInterpretation
interp
,
const
morfeusz
::
Morfeusz
*
morf
);
int
node_from
,
node_to
;
int
node_from
,
node_to
;
UnicodeString
orth
;
UnicodeString
orth
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment