ArpaParseOptions Struct Reference

Options that control ArpaFileParser. More...

#include <arpa-file-parser.h>

Collaboration diagram for ArpaParseOptions:

Public Types

enum  OovHandling { kRaiseError, kAddToSymbols, kReplaceWithUnk, kSkipNGram }
 

Public Member Functions

 ArpaParseOptions ()
 
void Register (OptionsItf *opts)
 

Public Attributes

int32 bos_symbol
 Symbol for <s>, Required non-epsilon. More...
 
int32 eos_symbol
 Symbol for </s>, Required non-epsilon. More...
 
int32 unk_symbol
 Symbol for <unk>, Required for kReplaceWithUnk. More...
 
OovHandling oov_handling
 How to handle OOV words in the file. More...
 
int32 max_warnings
 Maximum warnings to report, <0 unlimited. More...
 

Detailed Description

Options that control ArpaFileParser.

Definition at line 37 of file arpa-file-parser.h.

Member Enumeration Documentation

◆ OovHandling

Enumerator
kRaiseError 

Abort on OOV words.

kAddToSymbols 

Add novel words to the symbol table.

kReplaceWithUnk 

Replace OOV words with <unk>.

kSkipNGram 

Skip n-gram with OOV word and continue.

Definition at line 38 of file arpa-file-parser.h.

38  {
39  kRaiseError,
42  kSkipNGram
43  };
Add novel words to the symbol table.
Skip n-gram with OOV word and continue.
Replace OOV words with <unk>.

Constructor & Destructor Documentation

◆ ArpaParseOptions()

ArpaParseOptions ( )
inline

Definition at line 45 of file arpa-file-parser.h.

45  :
46  bos_symbol(-1), eos_symbol(-1), unk_symbol(-1),
int32 unk_symbol
Symbol for <unk>, Required for kReplaceWithUnk.
int32 eos_symbol
Symbol for </s>, Required non-epsilon.
int32 bos_symbol
Symbol for <s>, Required non-epsilon.
int32 max_warnings
Maximum warnings to report, <0 unlimited.
OovHandling oov_handling
How to handle OOV words in the file.

Member Function Documentation

◆ Register()

void Register ( OptionsItf opts)
inline

Definition at line 49 of file arpa-file-parser.h.

References ArpaParseOptions::max_warnings, and OptionsItf::Register().

49  {
50  // Registering only the max_warnings count, since other options are
51  // treated differently by client programs: some want integer symbols,
52  // while other are passed words in their command line.
53  opts->Register("max-arpa-warnings", &max_warnings,
54  "Maximum warnings to report on ARPA parsing, "
55  "0 to disable, -1 to show all");
56  }
int32 max_warnings
Maximum warnings to report, <0 unlimited.

Member Data Documentation

◆ bos_symbol

int32 bos_symbol

Symbol for <s>, Required non-epsilon.

Definition at line 58 of file arpa-file-parser.h.

Referenced by kaldi::Compile(), and ArpaFileParser::Read().

◆ eos_symbol

int32 eos_symbol

Symbol for </s>, Required non-epsilon.

Definition at line 59 of file arpa-file-parser.h.

Referenced by kaldi::Compile(), and ArpaFileParser::Read().

◆ max_warnings

int32 max_warnings

Maximum warnings to report, <0 unlimited.

Definition at line 62 of file arpa-file-parser.h.

Referenced by ArpaFileParser::Read(), ArpaParseOptions::Register(), and ArpaFileParser::ShouldWarn().

◆ oov_handling

OovHandling oov_handling

How to handle OOV words in the file.

Definition at line 61 of file arpa-file-parser.h.

Referenced by kaldi::Compile(), and ArpaFileParser::Read().

◆ unk_symbol

int32 unk_symbol

Symbol for <unk>, Required for kReplaceWithUnk.

Definition at line 60 of file arpa-file-parser.h.

Referenced by ArpaFileParser::Read().


The documentation for this struct was generated from the following file: