LibreOffice Module lingucomponent (master)  1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SimpleGuesser Class Referencefinal

#include <simpleguesser.hxx>

Public Member Functions

 SimpleGuesser ()
 inits the object with conf file "./conf.txt" More...
 
SimpleGuesseroperator= (const SimpleGuesser &sg)
 
 ~SimpleGuesser ()
 destroy the object More...
 
vector< GuessGuessLanguage (const char *text)
 Analyze a text and return the most probable languages of the text. More...
 
Guess GuessPrimaryLanguage (const char *text)
 Analyze a text and return the most probable language of the text. More...
 
vector< GuessGetAvailableLanguages ()
 List all available languages (possibly to be in guesses) More...
 
vector< GuessGetAllManagedLanguages ()
 List all languages (possibly in guesses or not) More...
 
vector< GuessGetUnavailableLanguages ()
 List all Unavailable languages (disable for any reason) More...
 
void EnableLanguage (const string &lang)
 Mark a language enabled. More...
 
void DisableLanguage (const string &lang)
 Mark a language disabled. More...
 
void SetDBPath (const char *thePathOfConfFile, const char *prefix)
 Load a new DB of fingerprints. More...
 

Private Member Functions

vector< GuessGetManagedLanguages (const char mask)
 Is used to know which language is available, unavailable or both when mask = 0xF0, return only Available when mask = 0x0F, return only Unavailable when mask = 0xFF, return both Available and Unavailable. More...
 
void XableLanguage (const string &lang, char mask)
 

Private Attributes

voidh
 

Detailed Description

Definition at line 32 of file simpleguesser.hxx.

Constructor & Destructor Documentation

SimpleGuesser::SimpleGuesser ( )

inits the object with conf file "./conf.txt"

Definition at line 86 of file simpleguesser.cxx.

References h.

SimpleGuesser::~SimpleGuesser ( )

destroy the object

Definition at line 101 of file simpleguesser.cxx.

References h.

Member Function Documentation

void SimpleGuesser::DisableLanguage ( const string &  lang)

Mark a language disabled.

Parameters
stringlang the language to disable (build like language-COUNTRY-encoding)

Definition at line 211 of file simpleguesser.cxx.

Referenced by LangGuess_Impl::disableLanguages().

void SimpleGuesser::EnableLanguage ( const string &  lang)

Mark a language enabled.

Parameters
stringlang the language to enable (build like language-COUNTRY-encoding)

Definition at line 206 of file simpleguesser.cxx.

Referenced by LangGuess_Impl::enableLanguages().

vector< Guess > SimpleGuesser::GetAllManagedLanguages ( )

List all languages (possibly in guesses or not)

Returns
the list of languages

Definition at line 187 of file simpleguesser.cxx.

Referenced by LangGuess_Impl::getAvailableLanguages().

vector< Guess > SimpleGuesser::GetAvailableLanguages ( )

List all available languages (possibly to be in guesses)

Returns
the list of languages

Definition at line 177 of file simpleguesser.cxx.

Referenced by LangGuess_Impl::getEnabledLanguages().

vector< Guess > SimpleGuesser::GetManagedLanguages ( const char  mask)
private

Is used to know which language is available, unavailable or both when mask = 0xF0, return only Available when mask = 0x0F, return only Unavailable when mask = 0xFF, return both Available and Unavailable.

Definition at line 156 of file simpleguesser.cxx.

References textcat_t::fprint, textcat_t::fprint_disable, h, i, and textcat_t::size.

vector< Guess > SimpleGuesser::GetUnavailableLanguages ( )

List all Unavailable languages (disable for any reason)

Returns
the list of languages

Definition at line 182 of file simpleguesser.cxx.

Referenced by LangGuess_Impl::getDisabledLanguages().

vector< Guess > SimpleGuesser::GuessLanguage ( const char *  text)

Analyze a text and return the most probable languages of the text.

Parameters
char*text is the text to analyze
Returns
the list of guess

Definition at line 109 of file simpleguesser.cxx.

References GUESS_SEPARATOR_OPEN, h, i, MAX_STRING_LENGTH_TO_ANALYSE, and TEXTCAT_RESULT_SHORT_STR.

Guess SimpleGuesser::GuessPrimaryLanguage ( const char *  text)

Analyze a text and return the most probable language of the text.

Parameters
char*text is the text to analyze
Returns
the guess (containing language)

Definition at line 145 of file simpleguesser.cxx.

Referenced by LangGuess_Impl::guessPrimaryLanguage().

SimpleGuesser & SimpleGuesser::operator= ( const SimpleGuesser sg)
Parameters
SimpleGuesser&sg the other guesser

Definition at line 91 of file simpleguesser.cxx.

References h, and h.

void SimpleGuesser::SetDBPath ( const char *  thePathOfConfFile,
const char *  prefix 
)

Load a new DB of fingerprints.

Parameters
constchar* thePathOfConfFile self explaining
constchar* prefix is the path where the directory which contains fingerprint files is stored

Definition at line 216 of file simpleguesser.cxx.

References h.

Referenced by LangGuess_Impl::SetFingerPrintsDB().

void SimpleGuesser::XableLanguage ( const string &  lang,
char  mask 
)
private

Member Data Documentation

void* SimpleGuesser::h
private

Definition at line 101 of file simpleguesser.hxx.

Referenced by operator=().


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