public bool Match(SolarixGrammarEngineNET.SyntaxTreeNode proj, int iver, SolarixGrammarEngineNET.GrammarEngine2 gren)
{
if (lexeme != null)
{
return(proj.GetWord().Equals(lexeme, StringComparison.InvariantCultureIgnoreCase));
}
if (id_lemma != null)
{
int ekey = proj.GetVersionEntryID(iver);
if (id_lemma.Contains(ekey))
{
return(true);
}
return(false);
}
if (pos != null)
{
bool pos_matched = false;
int ekey = proj.GetVersionEntryID(iver);
if (ekey != -1)
{
int id_class = gren.GetEntryClass(ekey);
pos_matched = pos.Contains(id_class);
}
if (!pos_matched)
{
return(false);
}
}
if (pairs != null)
{
bool contains_all_required_pairs = true;
foreach (SolarixGrammarEngineNET.CoordPair p in pairs)
{
if (!proj.VersionContains(iver, p))
{
contains_all_required_pairs = false;
break;
}
}
if (!contains_all_required_pairs)
{
return(false);
}
}
return(true);
}