Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WCCL
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Analysers
WCCL
Commits
bcef63ac
Commit
bcef63ac
authored
10 years ago
by
Radosław Warzocha
Browse files
Options
Downloads
Patches
Plain Diff
Parser and WcclFile have now their own copy of tagset
parent
a6fd8c0c
Branches
Branches containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
libwccl/parser/Parser.cpp
+7
-2
7 additions, 2 deletions
libwccl/parser/Parser.cpp
libwccl/parser/Parser.h
+3
-2
3 additions, 2 deletions
libwccl/parser/Parser.h
libwccl/wcclfile.cpp
+3
-3
3 additions, 3 deletions
libwccl/wcclfile.cpp
libwccl/wcclfile.h
+11
-3
11 additions, 3 deletions
libwccl/wcclfile.h
with
24 additions
and
10 deletions
libwccl/parser/Parser.cpp
+
7
−
2
View file @
bcef63ac
...
...
@@ -30,11 +30,16 @@ namespace Wccl {
/**
* @desc Parser constructor. Default tagset is NULL
*/
Parser
::
Parser
(
const
Corpus2
::
Tagset
&
t
)
:
tagset_
(
t
)
Parser
::
Parser
(
const
Corpus2
::
Tagset
&
t
)
:
tagset_
(
new
Corpus2
::
Tagset
(
t
)
)
{
}
Parser
::
Parser
(
const
std
::
string
&
tagset_name
)
:
tagset_
(
Corpus2
::
get_named_tagset
(
tagset_name
))
Parser
::
Parser
(
const
boost
::
shared_ptr
<
const
Corpus2
::
Tagset
>
)
:
tagset_
(
tagset
)
{
}
Parser
::
Parser
(
const
std
::
string
&
tagset_name
)
:
tagset_
(
new
Corpus2
::
Tagset
(
Corpus2
::
get_named_tagset
(
tagset_name
)))
{
}
...
...
This diff is collapsed.
Click to expand it.
libwccl/parser/Parser.h
+
3
−
2
View file @
bcef63ac
...
...
@@ -50,6 +50,7 @@ namespace Wccl{
class
Parser
{
public:
explicit
Parser
(
const
Corpus2
::
Tagset
&
);
explicit
Parser
(
const
boost
::
shared_ptr
<
const
Corpus2
::
Tagset
>
);
explicit
Parser
(
const
std
::
string
&
tagset_name
);
~
Parser
();
...
...
@@ -128,12 +129,12 @@ public:
const
std
::
string
&
search_path
=
"."
)
const
;
// ---------------------------------------------------------------------------
const
Corpus2
::
Tagset
&
tagset
()
const
{
const
boost
::
shared_ptr
<
Corpus2
::
Tagset
>
tagset
()
const
{
return
tagset_
;
}
private
:
const
Corpus2
::
Tagset
&
tagset_
;
const
boost
::
shared_ptr
<
const
Corpus2
::
Tagset
>
tagset_
;
};
}
// end Wccl ns
...
...
This diff is collapsed.
Click to expand it.
libwccl/wcclfile.cpp
+
3
−
3
View file @
bcef63ac
...
...
@@ -78,13 +78,13 @@ std::ostream& WcclFile::write_to(std::ostream& os) const
}
}
BOOST_FOREACH
(
const
boost
::
shared_ptr
<
FunctionalOpSequence
>&
s
,
all_sections_
)
{
os
<<
s
->
to_string
(
tagset_
)
<<
'\n'
;
os
<<
s
->
to_string
(
*
tagset_
)
<<
'\n'
;
}
if
(
has_tag_rules
())
{
os
<<
tag_rules_
->
to_string
(
tagset_
)
<<
'\n'
;
os
<<
tag_rules_
->
to_string
(
*
tagset_
)
<<
'\n'
;
}
if
(
has_match_rules
())
{
os
<<
match_rules_
->
to_string
(
tagset_
)
<<
'\n'
;
os
<<
match_rules_
->
to_string
(
*
tagset_
)
<<
'\n'
;
}
return
os
;
}
...
...
This diff is collapsed.
Click to expand it.
libwccl/wcclfile.h
+
11
−
3
View file @
bcef63ac
...
...
@@ -48,6 +48,7 @@ class WcclFile
{
public:
WcclFile
(
const
Corpus2
::
Tagset
&
tagset
,
const
std
::
string
&
search_path
);
WcclFile
(
const
boost
::
shared_ptr
<
const
Corpus2
::
Tagset
>
tagset
,
const
std
::
string
&
search
path
);
/////////////////////
// Untyped and typed operator sections: @X:"sectioname" ( op1; op2 )
...
...
@@ -340,7 +341,7 @@ public:
void
import_lexicon
(
const
boost
::
shared_ptr
<
Lexicon
>&
lexicon
);
void
set_tag_rules
(
const
boost
::
shared_ptr
<
TagRuleSequence
>&
tag_rules
);
void
set_match_rules
(
const
boost
::
shared_ptr
<
Matching
::
MatchRuleSequence
>&
match_rules
);
private:
...
...
@@ -349,7 +350,7 @@ private:
boost
::
shared_ptr
<
TagRuleSequence
>
tag_rules_
;
boost
::
shared_ptr
<
Matching
::
MatchRuleSequence
>
match_rules_
;
boost
::
shared_ptr
<
Lexicons
>
lexicons_
;
const
Corpus2
::
Tagset
&
tagset_
;
const
boost
::
shared_ptr
<
const
Corpus2
::
Tagset
>
tagset_
;
PwrNlp
::
PathSearcher
<
Wccl
::
FileNotFound
>
path_
;
};
...
...
@@ -362,6 +363,13 @@ namespace Wccl {
inline
WcclFile
::
WcclFile
(
const
Corpus2
::
Tagset
&
tagset
,
const
std
::
string
&
search_path
)
:
lexicons_
(
boost
::
make_shared
<
Lexicons
>
()),
tagset_
(
new
Corpus2
::
Tagset
(
tagset
)),
path_
(
":"
)
{
path_
.
set_search_path
(
search_path
);
path_
.
set_verbose
(
false
);
}
WcclFile
::
WcclFile
(
const
boost
::
shared_ptr
<
const
Corpus2
::
Tagset
>
tagset
,
const
std
::
string
&
search_path
)
:
lexicons_
(
boost
::
make_shared
<
Lexicons
>
()),
tagset_
(
tagset
),
path_
(
":"
)
{
...
...
@@ -664,7 +672,7 @@ std::ostream& operator <<(std::ostream& ostream, const WcclFile& wccl_file) {
}
inline
const
Corpus2
::
Tagset
&
WcclFile
::
tagset
()
const
{
const
boost
::
shared_ptr
<
Corpus2
::
Tagset
>
WcclFile
::
tagset
()
const
{
return
tagset_
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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