Class Parser
Class for a shift reduce style parser based on Adwait Ratnaparkhi's 1998 thesis.
public class Parser : AbstractBottomUpParser, IParser
- Inheritance
-
Parser
- Implements
- Inherited Members
Constructors
Parser(ParserModel, int, double)
public Parser(ParserModel model, int beamSize = 20, double advancePercentage = 0.95)
Parameters
modelParserModelbeamSizeintadvancePercentagedouble
Methods
AdvanceParses(Parse, double)
Advances the specified parse and returns the an array advanced parses whose probability accounts for more than the specified amount of probability mass.
protected override Parse[]? AdvanceParses(Parse p, double probMass)
Parameters
pParseThe parse to advance.
probMassdoubleThe amount of probability mass that should be accounted for by the advanced parses.
Returns
- Parse[]
AdvanceTop(Parse)
Adds the "TOP" node to the specified parse.
protected override void AdvanceTop(Parse p)
Parameters
pParseThe complete parse.
MergeReportIntoManifest(IDictionary<string, string>, IDictionary<string, string>, string)
public static void MergeReportIntoManifest(IDictionary<string, string> manifest, IDictionary<string, string> report, string @namespace)
Parameters
manifestIDictionary<string, string>reportIDictionary<string, string>namespacestring
Train(string, IObjectStream<Parse?>, IHeadRules, TrainingParameters)
public static ParserModel Train(string languageCode, IObjectStream<Parse?> parseSamples, IHeadRules rules, TrainingParameters mlParams)
Parameters
languageCodestringparseSamplesIObjectStream<Parse>rulesIHeadRulesmlParamsTrainingParameters
Returns
Exceptions
- IOException
if there is an error during reading