Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
corpus2
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
corpus2
Commits
ad9740b4
Commit
ad9740b4
authored
Feb 25, 2011
by
ilor
Browse files
Options
Downloads
Patches
Plain Diff
loose tag parsing option in xmlreader
parent
6183ea50
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
libcorpus2/io/xmlreader.cpp
+3
-1
3 additions, 1 deletion
libcorpus2/io/xmlreader.cpp
libcorpus2/io/xmlreader.h
+7
-0
7 additions, 0 deletions
libcorpus2/io/xmlreader.h
with
10 additions
and
1 deletion
libcorpus2/io/xmlreader.cpp
+
3
−
1
View file @
ad9740b4
...
...
@@ -33,6 +33,7 @@ XmlReader::XmlReader(const Tagset& tagset,
,
sbuf_
(),
tok_
(
NULL
),
sent_
(),
chunk_
(),
obuf_
(
obuf
)
,
disamb_only_
(
false
),
disamb_sh_
(
false
)
,
warn_on_inconsistent_
(
true
),
warn_on_unexpected_
(
true
)
,
loose_tag_parsing_
(
false
)
{
}
...
...
@@ -221,7 +222,8 @@ void XmlReader::on_end_element(const Glib::ustring &name)
grab_characters_
=
false
;
state_
=
STATE_LEX
;
}
else
if
(
state_
==
STATE_TAG
&&
name
==
"ctag"
)
{
Tag
tag
=
tagset_
.
parse_simple_tag
(
get_buf
(),
true
);
Tag
tag
=
tagset_
.
parse_simple_tag
(
get_buf
(),
loose_tag_parsing_
?
Tagset
::
ParseLoose
:
Tagset
::
ParseDefault
);
tok_
->
lexemes
().
back
().
set_tag
(
tag
);
grab_characters_
=
false
;
state_
=
STATE_LEX
;
...
...
This diff is collapsed.
Click to expand it.
libcorpus2/io/xmlreader.h
+
7
−
0
View file @
ad9740b4
...
...
@@ -51,6 +51,10 @@ public:
warn_on_unexpected_
=
v
;
}
void
set_loose_tag_parsing
(
bool
v
)
{
loose_tag_parsing_
=
v
;
}
protected
:
std
::
string
get_type_from_attributes
(
const
AttributeList
&
attributes
)
const
;
...
...
@@ -130,6 +134,9 @@ protected:
/// Tag name for sentence objects, customized in child class ctors
std
::
string
sentence_tag_name_
;
/// Flag to disable strict tag correctness checking
bool
loose_tag_parsing_
;
};
}
/* end ns Corpus2 */
...
...
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