High-level token information object.
|
| mootToken (mootTokenType type=TokTypeVanilla) |
|
| mootToken (const mootTokString &text, mootTokenType type=TokTypeVanilla) |
|
| mootToken (const mootTokString &text, const Analyses &analyses) |
|
| mootToken (const mootTokString &text, const Analyses &analyses, const mootTagString &besttag) |
|
| mootToken (const mootToken &x) |
|
| ~mootToken (void) |
|
mootToken & | operator= (const mootToken &x) |
|
void | clear (void) |
|
const mootTokString & | text (void) const |
|
mootTokString & | text (const mootTokString &text) |
|
mootTokString & | text (const char *s, size_t len) |
|
mootTokString & | textAppend (const mootTokString &text) |
|
mootTokString & | textAppend (const char *s, size_t len) |
|
const mootTagString & | besttag (void) const |
|
mootTagString & | besttag (const mootTagString &besttag) |
|
mootTagString & | besttagAppend (const mootTagString &text) |
|
mootTagString & | besttagAppend (const char *s, size_t len) |
|
mootTokenType | toktype (void) const |
|
mootTokenType | toktype (const mootTokenType type) |
|
const Analyses & | analyses (void) const |
|
const Analyses & | analyses (const Analyses &analyses) |
|
void | insert (const Analysis &analysis) |
|
void | insert (const mootTagString &tag, const mootTagString &details, ProbT p=0) |
|
void | insert (const char *tag, const char *details, ProbT p=0) |
|
bool | has_analysis_for_tag (const mootTagString &tag) const |
|
void | erase (const Analysis &analysis) |
|
void | prune (void) |
|
const Location & | location (void) const |
|
const Location & | location (const Location &loc) |
|
const Location & | location (const OffsetT offset, const OffsetT length=0) |
|
OffsetT | loc_offset (void) const |
|
OffsetT | loc_offset (const OffsetT off) |
|
OffsetT | loc_length (void) const |
|
OffsetT | loc_length (const OffsetT len) |
|
void | tokImport (const mootTokString *src_toktext=__null, const mootTagSet *src_tagset=__null) |
|
void | tokExport (mootTokString *dst_toktext=__null, mootTagSet *dst_tagset=__null, bool want_besttag_in_tagset=true) const |
|
void | dump (const char *label=__null, FILE *f=__null) const |
|
◆ Cost
Type for analysis weights
◆ Analyses
Type for multiple concurrent analyses : tag => set<Analysis>
◆ mootToken() [1/5]
Default constructor: empty text, no analyses
◆ mootToken() [2/5]
Constructor given only token text: no analyses
◆ mootToken() [3/5]
Constructor given text & analyses
◆ mootToken() [4/5]
Constructor given text & analyses & best tag
◆ mootToken() [5/5]
moot::mootToken::mootToken |
( |
const mootToken & |
x | ) |
|
|
inline |
◆ ~mootToken()
moot::mootToken::~mootToken |
( |
void |
| ) |
|
|
inline |
Constructor for text-only tokens from C buffer of known length
◆ operator=()
◆ clear()
void moot::mootToken::clear |
( |
void |
| ) |
|
|
inline |
◆ text() [1/3]
◆ text() [2/3]
◆ text() [3/3]
mootTokString& moot::mootToken::text |
( |
const char * |
s, |
|
|
size_t |
len |
|
) |
| |
|
inline |
◆ textAppend() [1/2]
Append to token text, returns new token-text
◆ textAppend() [2/2]
mootTokString& moot::mootToken::textAppend |
( |
const char * |
s, |
|
|
size_t |
len |
|
) |
| |
|
inline |
Append to token text, returns new token-text
◆ besttag() [1/2]
◆ besttag() [2/2]
◆ besttagAppend() [1/2]
Append to 'besttag' text, returns new text
◆ besttagAppend() [2/2]
mootTagString& moot::mootToken::besttagAppend |
( |
const char * |
s, |
|
|
size_t |
len |
|
) |
| |
|
inline |
Append to 'besttag' text, returns new text
◆ toktype() [1/2]
◆ toktype() [2/2]
◆ analyses() [1/2]
const Analyses& moot::mootToken::analyses |
( |
void |
| ) |
const |
|
inline |
◆ analyses() [2/2]
◆ insert() [1/3]
void moot::mootToken::insert |
( |
const Analysis & |
analysis | ) |
|
|
inline |
◆ insert() [2/3]
◆ insert() [3/3]
void moot::mootToken::insert |
( |
const char * |
tag, |
|
|
const char * |
details, |
|
|
ProbT |
p = 0 |
|
) |
| |
|
inline |
Insert a new analysis, C-style
◆ has_analysis_for_tag()
bool moot::mootToken::has_analysis_for_tag |
( |
const mootTagString & |
tag | ) |
const |
|
inline |
Test presence of an analysis for 'tag'
◆ erase()
void moot::mootToken::erase |
( |
const Analysis & |
analysis | ) |
|
|
inline |
◆ prune()
void moot::mootToken::prune |
( |
void |
| ) |
|
|
inline |
Prune analyses, retaining only those for 'besttag'
◆ location() [1/3]
const Location& moot::mootToken::location |
( |
void |
| ) |
const |
|
inline |
◆ location() [2/3]
◆ location() [3/3]
Set token location directly from member variables
◆ loc_offset() [1/2]
OffsetT moot::mootToken::loc_offset |
( |
void |
| ) |
const |
|
inline |
◆ loc_offset() [2/2]
◆ loc_length() [1/2]
OffsetT moot::mootToken::loc_length |
( |
void |
| ) |
const |
|
inline |
◆ loc_length() [2/2]
◆ tokImport()
void moot::mootToken::tokImport |
( |
const mootTokString * |
src_toktext = __null , |
|
|
const mootTagSet * |
src_tagset = __null |
|
) |
| |
|
inline |
For backwards-compatibility: convert old-style 'text,tags' pair to a mootToken.
- Warning
- current analysis-set is NOT cleared by this method.
◆ tokExport()
void moot::mootToken::tokExport |
( |
mootTokString * |
dst_toktext = __null , |
|
|
mootTagSet * |
dst_tagset = __null , |
|
|
bool |
want_besttag_in_tagset = true |
|
) |
| const |
|
inline |
For lazy backwards-compatibility: convert mootToken back to old-style 'text,tagset' pair.
- Parameters
-
dst_toktext | pointer to destination token-text. NULL (default) means don't export text. |
dst_tagset | pointer to destination tagset. NULL (default) means don't export tagset. |
want_besttag_in_tagset | whether to include besttag in exported tagset. Default=true. |
- Warning
- argument tagset is NOT cleared by this method.
◆ dump()
void moot::mootToken::dump |
( |
const char * |
label = __null , |
|
|
FILE * |
f = __null |
|
) |
| const |
dump token data in human-readable format to file f (default=stderr)
◆ operator==
◆ operator<
◆ tok_type
◆ tok_text
◆ tok_besttag
◆ tok_analyses
Set of possible analyses as a mootToken::AnalysisSet
Referenced by operator=().
◆ tok_location
Token location in input stream, for backtraces (optional)
Referenced by operator=().
◆ tok_data
void* moot::mootToken::tok_data |
Additional user data for this token, defaults to NULL. User is responsible for memory management.
Referenced by operator=().
The documentation for this class was generated from the following file: