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
4a616ed2
Commit
4a616ed2
authored
14 years ago
by
ilor
Browse files
Options
Downloads
Patches
Plain Diff
Add query file loading to wcclparser
parent
f96ec109
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wcclparser/main.cpp
+13
-0
13 additions, 0 deletions
wcclparser/main.cpp
with
13 additions
and
0 deletions
wcclparser/main.cpp
+
13
−
0
View file @
4a616ed2
...
...
@@ -153,6 +153,7 @@ int main(int argc, char** argv)
std
::
string
tagset_load
=
"kipi"
;
std
::
string
query
=
""
;
std
::
string
sentence_load
=
""
;
std
::
string
query_load
=
""
;
std
::
string
position
=
"0"
;
bool
quiet
=
false
;
using
boost
::
program_options
::
value
;
...
...
@@ -165,6 +166,8 @@ int main(int argc, char** argv)
"Sentence to load (XCES)
\n
"
)
(
"position,p"
,
value
(
&
position
),
"Position in the sentence to use, 'all' iterates through the sentence
\n
"
)
(
"query-file,f"
,
value
(
&
query_load
),
"Run query from file (disables interactive mode)
\n
"
)
(
"query,Q"
,
value
(
&
query
),
"Query to run (disables interactive mode)
\n
"
)
(
"quiet,q"
,
value
(
&
quiet
)
->
zero_tokens
(),
...
...
@@ -213,6 +216,16 @@ int main(int argc, char** argv)
if
(
!
query
.
empty
())
{
process_line
(
query
,
parser
,
sc
,
position
==
"all"
);
return
0
;
}
else
if
(
!
query_load
.
empty
())
{
std
::
ifstream
qf
(
query_load
.
c_str
());
if
(
qf
.
good
())
{
std
::
stringstream
ss
;
ss
<<
qf
.
rdbuf
();
process_line
(
ss
.
str
(),
parser
,
sc
,
position
==
"all"
);
return
0
;
}
else
{
throw
Wccl
::
FileNotFound
(
sentence_load
,
""
,
"Query file"
);
}
}
boost
::
function
<
bool
(
const
std
::
string
&
)
>
f
;
f
=
boost
::
bind
(
&
process_line
,
_1
,
boost
::
ref
(
parser
),
boost
::
ref
(
sc
),
...
...
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