Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
corpus2
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
corpus2
Commits
1983e13a
Commit
1983e13a
authored
14 years ago
by
ilor
Browse files
Options
Downloads
Patches
Plain Diff
Better error message when a parsed tag has a missing reqiured attribute
parent
c0e49046
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libcorpus2/tagset.cpp
+10
-0
10 additions, 0 deletions
libcorpus2/tagset.cpp
with
10 additions
and
0 deletions
libcorpus2/tagset.cpp
+
10
−
0
View file @
1983e13a
...
...
@@ -282,6 +282,16 @@ Tag Tagset::make_tag(idx_t pos_idx, mask_t values, bool allow_extra) const
// << " of " << pos_required_attributes_idx_[pos_idx].size() << "\n";
size_t
has_req
=
PwrNlp
::
count_bits_set
(
required_values
&
values
);
if
(
has_req
!=
pos_required_attributes_idx_
[
pos_idx
].
size
())
{
foreach
(
idx_t
a
,
get_pos_attributes
(
pos_idx
))
{
if
(
pos_requires_attribute
(
pos_idx
,
a
))
{
mask_t
amask
=
get_attribute_mask
(
a
);
if
((
values
&
amask
).
none
())
{
throw
TagParseError
(
"Required attribute missing"
,
tag_to_string
(
Tag
(
get_pos_mask
(
pos_idx
),
values
)),
get_attribute_name
(
a
),
id_string
());
}
}
}
throw
TagParseError
(
"Required attribute missing"
,
tag_to_string
(
Tag
(
get_pos_mask
(
pos_idx
),
values
)),
get_pos_name
(
pos_idx
),
id_string
());
...
...
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