Skip to content
Snippets Groups Projects
Commit 33dc14da authored by Adam Radziszewski's avatar Adam Radziszewski
Browse files

convenience function to set disambs when tag=wanted_tag

parent e1f1bf11
Branches
No related merge requests found
......@@ -168,4 +168,11 @@ bool disambiguate_subset(Token* token, const Tag& mask_where,
return true;
}
void set_disambs(Token *token, const Tag& wanted_tag)
{
foreach (Lexeme& lex, token->lexemes()) {
lex.set_disamb(lex.tag() == wanted_tag);
}
}
} /* end ns Corpus2 */
......@@ -97,6 +97,8 @@ bool disambiguate_equal(Token* token, const Tag& mask_where,
bool disambiguate_subset(Token* token, const Tag& mask_where,
const Tag& mask_wanted);
/** Sets lexemes' disamb markers iff lexeme.tag is wanted_tag. */
void set_disambs(Token *token, const Tag& wanted_tag);
} /* end ns Corpus2 */
#endif // LIBCORPUS2_TAGGING_H
......@@ -37,6 +37,7 @@ bool disambiguate_equal(Token* token, const Tag& mask_where, const Tag& mask_wan
bool disambiguate_subset(Token* token, const Tag& mask_where, const Tag& mask_wanted);
void set_disambs(Token *token, const Tag& wanted_tag);
}
using namespace std;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment