Class Parser

Namespace
NOpenNLP.Tools.Parser.Chunking
Assembly
NOpenNLP.Tools.dll

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

model ParserModel
beamSize int
advancePercentage double

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

p Parse

The parse to advance.

probMass double

The 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

p Parse

The 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

manifest IDictionary<string, string>
report IDictionary<string, string>
namespace string

Train(string, IObjectStream<Parse?>, IHeadRules, TrainingParameters)

public static ParserModel Train(string languageCode, IObjectStream<Parse?> parseSamples, IHeadRules rules, TrainingParameters mlParams)

Parameters

languageCode string
parseSamples IObjectStream<Parse>
rules IHeadRules
mlParams TrainingParameters

Returns

ParserModel

Exceptions

IOException

if there is an error during reading