ace::PartOfContext Class Reference

Part of context is smallest unit used for context tracing functionality. More...

#include <context.h>

List of all members.

Public Member Functions

 PartOfContext (string_index_t lemma, tag_index_t tag, bool narrow=false)
 Constructor needs to know lemma and morphologic tag.
bool operator== (const PartOfContext &rhs) const
 Two contexts are equal if they are binded to the same lemma and tag.
context_frequency_t frequency (void) const
void inc (void)
 Increment frequency counter.
bool is_part_of_narrow (void) const
bool is_part_of_wide (void) const
string_index_t lemma (void) const
tag_index_t tag (void) const

Private Attributes

context_frequency_t _frequency
 Word frequency.
TaggedLemma _tagged_lemma
 Word lemma and tag altogether.

Static Private Attributes

static const context_frequency_t _max_frequency = std::numeric_limits<context_frequency_t>::max() >> 1
static const context_frequency_t _narrow_flag_bitmask = ~PartOfContext::_max_frequency


Detailed Description

Part of context is smallest unit used for context tracing functionality.

It holds data for any word founded within context (in general): 1. word lemma 2. word morphologic tag 3. word frequency


Constructor & Destructor Documentation

ace::PartOfContext::PartOfContext ( string_index_t  lemma,
tag_index_t  tag,
bool  narrow = false 
) [inline]

Constructor needs to know lemma and morphologic tag.

It also set frequency counter to 1.

Parameters:
lemma Word lemma.
tag Word morphologic tag.
narrow If true -> part of narrow context, if false -> part of wide one.


Member Function Documentation

bool ace::PartOfContext::operator== ( const PartOfContext rhs  )  const [inline]

Two contexts are equal if they are binded to the same lemma and tag.

Parameters:
rhs Part of context to compare.
Returns:
True, if given context is equal to self.

context_frequency_t ace::PartOfContext::frequency ( void   )  const [inline]

Returns:
Frequency of given part of context.

void ace::PartOfContext::inc ( void   ) 

Increment frequency counter.

Exceptions:
context_part_frequency_index_overflow In case of frequency counter overflow.

bool ace::PartOfContext::is_part_of_narrow ( void   )  const [inline]

Returns:
True, if given word is part of narrow context.

bool ace::PartOfContext::is_part_of_wide ( void   )  const [inline]

Returns:
True, if given word is part of wide context.

string_index_t ace::PartOfContext::lemma ( void   )  const [inline]

Returns:
Word lemma of given part of context.

tag_index_t ace::PartOfContext::tag ( void   )  const [inline]

Returns:
Morphologic tag of given part of context.


Member Data Documentation

const context_frequency_t ace::PartOfContext::_max_frequency = std::numeric_limits<context_frequency_t>::max() >> 1 [static, private]

Word frequency.

Word lemma and tag altogether.


The documentation for this class was generated from the following files:

Generated on Wed Aug 6 23:25:50 2008 for PACE by  doxygen 1.5.6