xapian-core  1.4.26
Public Member Functions | Private Member Functions | Private Attributes | List of all members
NgramIterator Class Reference

Iterator returning unigrams and bigrams. More...

#include <word-breaker.h>

+ Collaboration diagram for NgramIterator:

Public Member Functions

 NgramIterator (const std::string &s)
 
 NgramIterator (const Xapian::Utf8Iterator &it_)
 
 NgramIterator ()
 
const std::string & operator* () const
 
NgramIteratoroperator++ ()
 
bool unigram () const
 Is this a unigram? More...
 
const Xapian::Utf8Iteratorget_utf8iterator () const
 
bool operator== (const NgramIterator &other) const
 
bool operator!= (const NgramIterator &other) const
 

Private Member Functions

void init ()
 Call to set current_token at the start. More...
 

Private Attributes

Xapian::Utf8Iterator it
 
unsigned offset = 0
 Offset to penultimate Unicode character in current_token. More...
 
std::string current_token
 

Detailed Description

Iterator returning unigrams and bigrams.

Definition at line 52 of file word-breaker.h.

Constructor & Destructor Documentation

◆ NgramIterator() [1/3]

NgramIterator::NgramIterator ( const std::string &  s)
inlineexplicit

Definition at line 67 of file word-breaker.h.

References init().

◆ NgramIterator() [2/3]

NgramIterator::NgramIterator ( const Xapian::Utf8Iterator it_)
inlineexplicit

Definition at line 71 of file word-breaker.h.

References init().

◆ NgramIterator() [3/3]

NgramIterator::NgramIterator ( )
inline

Definition at line 75 of file word-breaker.h.

Member Function Documentation

◆ get_utf8iterator()

const Xapian::Utf8Iterator& NgramIterator::get_utf8iterator ( ) const
inline

Definition at line 86 of file word-breaker.h.

References it.

Referenced by Xapian::parse_terms().

◆ init()

void NgramIterator::init ( )
private

Call to set current_token at the start.

Definition at line 96 of file word-breaker.cc.

References Xapian::Unicode::append_utf8(), is_unbroken_script(), and Xapian::Unicode::is_wordchar().

Referenced by NgramIterator().

◆ operator!=()

bool NgramIterator::operator!= ( const NgramIterator other) const
inline

Definition at line 94 of file word-breaker.h.

◆ operator*()

const std::string& NgramIterator::operator* ( ) const
inline

Definition at line 77 of file word-breaker.h.

References current_token, and operator++().

◆ operator++()

NgramIterator & NgramIterator::operator++ ( )

◆ operator==()

bool NgramIterator::operator== ( const NgramIterator other) const
inline

Definition at line 88 of file word-breaker.h.

References current_token.

◆ unigram()

bool NgramIterator::unigram ( ) const
inline

Is this a unigram?

Definition at line 84 of file word-breaker.h.

Referenced by Xapian::parse_terms().

Member Data Documentation

◆ current_token

std::string NgramIterator::current_token
private

Definition at line 61 of file word-breaker.h.

Referenced by operator*(), and operator==().

◆ it

Xapian::Utf8Iterator NgramIterator::it
private

Definition at line 53 of file word-breaker.h.

Referenced by get_utf8iterator().

◆ offset

unsigned NgramIterator::offset = 0
private

Offset to penultimate Unicode character in current_token.

If current_token has one Unicode character, this is 0.

Definition at line 59 of file word-breaker.h.


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