OpenTREP Logo  0.6.0
C++ Open Travel Request Parsing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OPENTREP Namespace Reference

Namespaces

 PorParserHelper
 
 LOG
 

Classes

struct  BasChronometer
 Structure allowing measuring the time elapsed between two events. More...
 
struct  ListGenerator
 
struct  BasFileMgr
 Helper class for operations on files and on the file-system. More...
 
struct  short_bool_policies
 
class  OTransliterator
 
struct  ScoreType
 Enumeration of score types. More...
 
struct  StructAbstract
 Base class for the light structures. More...
 
class  UTF8Handler
 Utility class for basic handling of UTF-8 encoded strings. More...
 
class  BomAbstract
 Base class for the Business Object Model (BOM) layer. More...
 
class  BomJSONExport
 Utility class to export Opentrep structures in a JSON format. More...
 
struct  BomType
 
struct  Filter
 Class filtering out the words not suitable for indexing and/or searching, when part of greater strings. Hence, most of the methods take as parameter the "initial"/greater string. More...
 
class  KeyAbstract
 Base class for the Business Object Model (KEY) layer. More...
 
class  Levenshtein
 
class  LocationExchange
 Utility class to export Opentrep structures in a Protobuf format. More...
 
class  Place
 Class modelling a place/POR (point of reference). More...
 
class  PlaceHolder
 
class  PORStringParser
 
class  PORFileParser
 
struct  QuerySlices
 
class  Result
 Class wrapping a set of Xapian documents having matched a given query string. More...
 
class  ResultCombination
 Class wrapping functions on a list of ResultHolder objects. More...
 
class  ResultHolder
 Class wrapping functions on a list of Result objects. More...
 
struct  ScoreBoard
 Structure holding a board for all the types of score/matching having been performed. More...
 
struct  StringPartition
 
struct  StringSet
 Class holding a set of strings, e.g., {"rio", "de", "janeiro"}. More...
 
struct  WordCombinationHolder
 
class  WordHolder
 Class wrapping utility functions to transform back and forth strings from and into a list of words. More...
 
class  World
 
class  DBManager
 Class building the Business Object Model (BOM) from data retrieved from the database. More...
 
class  DBSessionManager
 Class handling the SOCI session. More...
 
class  IndexBuilder
 Command wrapping the travel request process. More...
 
class  PORParser
 
class  RequestInterpreter
 Command wrapping the travel request process. More...
 
class  XapianIndexManager
 Command wrapping utilities for the management of the Xapian (database) index. More...
 
class  DbaAbstract
 
struct  DBParams
 Structure modelling a database parameters. More...
 
struct  DistanceErrorRule
 
class  FacBomAbstract
 
class  FacOpenTrepServiceContext
 Factory for Bucket. More...
 
class  FacPlace
 
class  FacPlaceHolder
 
class  FacResult
 
class  FacResultCombination
 
class  FacResultHolder
 
class  FacServiceAbstract
 
class  FacSupervisor
 
class  FacWorld
 
struct  IATAType
 Enumeration of output types. More...
 
struct  Language
 
struct  Location
 Structure modelling a (geographical) location. More...
 
struct  LocationKey
 Class modelling the primary key of a location/POR (point of reference). More...
 
struct  NameMatrix
 
struct  Names
 
struct  OPENTREP_Abstract
 
class  RootException
 Root of the OpenTREP exceptions. More...
 
class  NonInitialisedServiceException
 
class  UnicodeException
 
class  UnicodeTransliteratorCreationException
 
class  MultipleRowsForASingleDocIDException
 
class  LanguageCodeNotDefinedInNameTableException
 
class  MemoryAllocationException
 
class  ObjectNotFoundException
 
class  FileException
 
class  FileNotFoundException
 
class  ParserException
 
class  PorFileParsingException
 
class  PRFileParsingException
 
class  CodeConversionException
 
class  CodeDuplicationException
 
class  XapianException
 
class  DocumentNotFoundException
 
class  XapianDatabaseFailureException
 
class  XapianTravelDatabaseEmptyException
 
class  XapianTravelDatabaseWrongPathnameException
 
class  NoBestMatchingResultHolderException
 
class  SQLDatabaseException
 
class  SQLDatabaseConnectionImpossibleException
 
class  BuildIndexException
 
class  InterpreterUseCaseException
 
class  InterpreteTravelRequestException
 
class  TravelRequestEmptyException
 
struct  date_time_element
 
class  OPENTREP_Service
 Interface for the OPENTREP Services. More...
 
struct  FilePath_T
 
struct  PORFilePath_T
 
struct  TravelDBFilePath_T
 
struct  SQLiteDBFilePath_T
 
struct  RawDataString_T
 
struct  IATACode_T
 
struct  ICAOCode_T
 
struct  FAACode_T
 
struct  LocationName_T
 
struct  CommonName_T
 
struct  ASCIIName_T
 
struct  AltNameShortListString_T
 
struct  TvlPORListString_T
 
struct  LanguageCode_T
 
struct  Comment_T
 
struct  CityCode_T
 
struct  CityUTFName_T
 
struct  CityASCIIName_T
 
struct  StateCode_T
 
struct  CountryCode_T
 
struct  AltCountryCode_T
 
struct  CountryName_T
 
struct  ContinentCode_T
 
struct  ContinentName_T
 
struct  Admin1Code_T
 
struct  Admin1UTFName_T
 
struct  Admin1ASCIIName_T
 
struct  Admin2Code_T
 
struct  Admin2UTFName_T
 
struct  Admin2ASCIIName_T
 
struct  Admin3Code_T
 
struct  Admin4Code_T
 
struct  FeatureClass_T
 
struct  FeatureCode_T
 
struct  FeatureName_T
 
struct  WikiLink_T
 
struct  TimeZone_T
 
struct  OutputFormat
 Enumeration of output formats. More...
 
struct  OpenTrepSearcher
 API wrapper around the OpenTREP C++ API, so that Python scripts can use it seamlessly. More...
 
class  Logger
 
class  OPENTREP_ServiceContext
 Class holding the context of the OpenTrep services. More...
 
class  ServiceAbstract
 
class  ServiceUtilities
 

Typedefs

typedef
std::istreambuf_iterator< char > 
base_iterator_t
 
typedef
boost::spirit::multi_pass
< base_iterator_t
iterator_t
 
typedef
boost::spirit::classic::position_iterator2
< iterator_t
pos_iterator_t
 
typedef
boost::spirit::qi::uint_parser
< int, 10, 1, 1 > 
uint1_p_t
 
typedef
boost::spirit::qi::uint_parser
< int, 10, 2, 2 > 
uint2_p_t
 
typedef
boost::spirit::qi::uint_parser
< int, 10, 1, 2 > 
int1_2_p_t
 
typedef
boost::spirit::qi::uint_parser
< int, 10, 4, 4 > 
uint4_p_t
 
typedef
boost::spirit::qi::int_parser
< int, 10, 1, 5 > 
int1_5_p_t
 
typedef
boost::spirit::qi::int_parser
< int, 10, 0, 5 > 
int0_5_p_t
 
typedef
boost::spirit::qi::uint_parser
< int, 10, 1, 4 > 
uint1_4_p_t
 
typedef
boost::spirit::qi::uint_parser
< int, 10, 1, 9 > 
uint1_9_p_t
 
typedef
boost::spirit::qi::uint_parser
< int, 10, 0, 9 > 
uint0_9_p_t
 
typedef
boost::spirit::qi::uint_parser
< hour_t, 10, 2, 2 > 
hour_p_t
 
typedef
boost::spirit::qi::uint_parser
< minute_t, 10, 2, 2 > 
minute_p_t
 
typedef
boost::spirit::qi::uint_parser
< second_t, 10, 2, 2 > 
second_p_t
 
typedef
boost::spirit::qi::uint_parser
< year_t, 10, 4, 4 > 
year_p_t
 
typedef
boost::spirit::qi::uint_parser
< month_t, 10, 2, 2 > 
month_p_t
 
typedef
boost::spirit::qi::uint_parser
< day_t, 10, 2, 2 > 
day_p_t
 
typedef
boost::spirit::qi::bool_parser
< bool, short_bool_policies
boolean_p_t
 
typedef long unsigned int u_int32_t
 
typedef std::list
< MatchingDocuments > 
DocumentList_T
 
typedef std::pair
< BomType::EN_BomType,
BomAbstract * > 
GenericBom_T
 
typedef std::map< std::size_t,
GenericBom_T
GenericBomList_T
 
typedef std::multimap
< std::string, Place * > 
PlaceList_T
 
typedef std::list< Place * > PlaceOrderedList_T
 
typedef std::pair
< Xapian::Document, ScoreBoard
XapianDocumentPair_T
 
typedef std::map
< Xapian::docid,
XapianDocumentPair_T
DocumentMap_T
 
typedef std::list< ResultHolder * > ResultHolderList_T
 
typedef std::list< Result * > ResultList_T
 
typedef std::list
< StringPartition
StringPartitionList_T
 
typedef std::size_t WorldID_T
 
typedef std::list< std::string > DBParamsNameList_T
 
typedef std::list< LocationLocationList_T
 
typedef std::list< std::string > NameList_T
 
typedef std::map
< LanguageCode_T, Names
NameMatrix_T
 
typedef date_time_element< 0, 23 > hour_t
 
typedef date_time_element< 0, 59 > minute_t
 
typedef date_time_element< 0, 59 > second_t
 
typedef date_time_element< 1900, 2100 > year_t
 
typedef date_time_element< 1, 12 > month_t
 
typedef date_time_element< 1, 31 > day_t
 
typedef int GeonamesID_T
 
typedef int EnvelopeID_T
 
typedef std::list
< AltNameShortListString_T
AltNameShortList_T
 
typedef std::list
< TvlPORListString_T
TvlPORList_T
 
typedef std::list< FeatureName_TFeatureNameList_T
 
typedef double GeoCoord_T
 
typedef GeoCoord_T Latitude_T
 
typedef GeoCoord_T Longitude_T
 
typedef boost::gregorian::date Date_T
 
typedef unsigned int Population_T
 
typedef int Elevation_T
 
typedef int GTopo30_T
 
typedef double PageRank_T
 
typedef int XapianDocID_T
 
typedef float GMTOffset_T
 
typedef float DSTOffset_T
 
typedef float RawOffset_T
 
typedef bool IsGeonames_T
 
typedef bool IsAirport_T
 
typedef bool IsCommercial_T
 
typedef unsigned short Weight_T
 
typedef std::string TravelQuery_T
 
typedef double MatchingPercentage_T
 
typedef double Percentage_T
 
typedef double Score_T
 
typedef unsigned int NbOfDBEntries_T
 
typedef std::string Word_T
 
typedef std::list< Word_TWordList_T
 
typedef std::set< std::string > WordSet_T
 
typedef std::set< std::string > BlackList_T
 
typedef unsigned int NbOfLetters_T
 
typedef unsigned short NbOfWords_T
 
typedef unsigned short NbOfMatches_T
 
typedef unsigned short NbOfErrors_T
 
typedef std::map
< NbOfLetters_T, NbOfErrors_T
DistanceErrorScale_T
 
typedef boost::array
< NbOfLetters_T, 5 > 
DistanceErrorScaleArray_T
 

Functions

const std::string DEFAULT_OPENTREP_POR_FILEPATH (OPENTREP_POR_DATA_DIR"/ori_por_public.csv")
 
const std::string DEFAULT_OPENTREP_XAPIAN_DB_FILEPATH ("/tmp/opentrep/traveldb")
 
const std::string DEFAULT_OPENTREP_MYSQL_DB_USER ("geo")
 
const std::string DEFAULT_OPENTREP_MYSQL_DB_PASSWD ("geo")
 
const std::string DEFAULT_OPENTREP_MYSQL_DB_DBNAME ("geo_ori")
 
const std::string DEFAULT_OPENTREP_MYSQL_DB_HOST ("localhost")
 
const std::string DEFAULT_OPENTREP_MYSQL_DB_PORT ("3306")
 
const std::string DEFAULT_OPENTREP_SQLITE_DB_FILEPATH (OPENTREP_POR_DATA_DIR"/ori_por_public.db")
 
const std::string DEFAULT_DATE_STR ("1970-01-01")
 
const NbOfMatches_T K_DEFAULT_XAPIAN_MATCHING_SET_SIZE (30)
 
const Weight_T K_DEFAULT_INDEXING_STD_WEIGHT (1)
 
const Weight_T K_DEFAULT_INDEXING_EXTRA_WEIGHT (2)
 
const Percentage_T K_DEFAULT_MODIFIED_MATCHING_PCT (100.0)
 
const Percentage_T K_DEFAULT_PAGE_RANK (0.10)
 
const Percentage_T K_DEFAULT_ENVELOPE_PCT (K_DEFAULT_PAGE_RANK)
 
const Percentage_T K_DEFAULT_FULL_CODE_MATCH_PCT (11000/K_DEFAULT_PAGE_RANK)
 
const Percentage_T K_DEFAULT_ATTENUATION_FCTR (34.0)
 
const NbOfErrors_T K_DEFAULT_SIZE_FOR_SPELLING_ERROR_UNIT (4)
 
bool check (const UErrorCode &iStatus, const char *iMsg)
 
UnicodeString & appendHex (const uint32_t iNumber, int8_t ioDigits, UnicodeString &ioTarget)
 
UnicodeString escape (const UnicodeString &iSource)
 
std::string getUTF8 (const UnicodeString &iString)
 
void tokeniseStringIntoWordList (const std::string &iPhrase, WordList_T &ioWordList)
 
std::string createStringFromWordList (const WordList_T &iWordList, const unsigned short iSplitIdx, const bool iFromBeginningFlag)
 
bool hasGoodSize (const std::string &iWord, const NbOfLetters_T &iMinWordLength)
 
bool isBlackListed (const std::string &iWord)
 
void rtrim (WordList_T &ioWordList, const NbOfLetters_T &iMinWordLength)
 
void ltrim (WordList_T &ioWordList, const NbOfLetters_T &iMinWordLength)
 
void trim (WordList_T &ioWordList, const NbOfLetters_T &iMinWordLength)
 
static unsigned int calculateEditDistance (const TravelQuery_T &iPhrase)
 Helper function. More...
 
bool doesMatch (const Xapian::Database &iDatabase, const std::string &iWord1, const std::string &iWord2)
 Helper function to query for a Xapian-based full text match. More...
 
static unsigned int calculateEditDistance (const TravelQuery_T &iPhrase)
 Helper function. More...
 
static const
boost::char_separator< char > 
AllSepatorList (" .,;:|+-*/_=!@#$%`~^&(){}[]?'<>\"")
 
static const
boost::char_separator< char > 
DocSepatorList (" ,-%")
 
void baseTokeniseStringIntoWordList (const std::string &iPhrase, WordList_T &ioWordList, const boost::char_separator< char > &iSepatorList)
 
void addToXapian (const Place &iPlace, Xapian::Document &ioDocument, Xapian::WritableDatabase &ioDatabase)
 
void addUnmatchedWord (const TravelQuery_T &iQueryString, WordList_T &ioWordList, WordSet_T &ioWordSet)
 
void createPlaces (const ResultCombination &iResultCombination, PlaceHolder &ioPlaceHolder)
 
void searchString (const StringPartition &iStringPartition, const Xapian::Database &iDatabase, ResultCombination &ioResultCombination, WordList_T &ioWordList)
 
void chooseBestMatchingResultHolder (ResultCombination &ioResultCombination)
 
boost::filesystem::path checkTravelDBFilePath (const TravelDBFilePath_T &iTravelDBFilePath)
 
template<int MIN, int MAX>
date_time_element< MIN, MAX > operator* (const date_time_element< MIN, MAX > &o1, const date_time_element< MIN, MAX > &o2)
 
template<int MIN, int MAX>
date_time_element< MIN, MAX > operator+ (const date_time_element< MIN, MAX > &o1, const date_time_element< MIN, MAX > &o2)
 
void logInit (const LOG::EN_LogLevel iLogLevel, std::ostream &ioLogOutputFile)
 

Variables

const std::tm DEFAULT_DATE_TM
 
const char * K_ICU_ACCENT_REMOVAL_RULE = "NFD; [:M:] Remove; NFC;"
 
const char * K_ICU_QUOTATION_REMOVAL_RULE
 
const char * K_ICU_PUNCTUATION_REMOVAL_RULE = "[:P:] Remove;"
 
const char * K_ICU_GENERIC_TRANSLITERATOR_RULE
 
const BlackList_T K_BLACK_LIST = ListGenerator::createBlackList()
 
const NbOfMatches_T K_DEFAULT_XAPIAN_MATCHING_SET_SIZE
 
const Weight_T K_DEFAULT_INDEXING_STD_WEIGHT
 
const Weight_T K_DEFAULT_INDEXING_EXTRA_WEIGHT
 
const Percentage_T K_DEFAULT_MODIFIED_MATCHING_PCT
 
const Percentage_T K_DEFAULT_PAGE_RANK
 
const Percentage_T K_DEFAULT_ENVELOPE_PCT
 
const Percentage_T K_DEFAULT_FULL_CODE_MATCH_PCT
 
const Percentage_T K_DEFAULT_ATTENUATION_FCTR
 
const NbOfErrors_T K_DEFAULT_SIZE_FOR_SPELLING_ERROR_UNIT
 
const std::string DEFAULT_DATE_STR
 
const std::string DEFAULT_OPENTREP_POR_FILEPATH
 
const std::string DEFAULT_OPENTREP_XAPIAN_DB_FILEPATH
 
const std::string DEFAULT_OPENTREP_MYSQL_DB_USER
 
const std::string DEFAULT_OPENTREP_MYSQL_DB_PASSWD
 
const std::string DEFAULT_OPENTREP_MYSQL_DB_DBNAME
 
const std::string DEFAULT_OPENTREP_MYSQL_DB_HOST
 
const std::string DEFAULT_OPENTREP_MYSQL_DB_PORT
 
const std::string DEFAULT_OPENTREP_SQLITE_DB_FILEPATH
 
static const u_int32_t offsetsFromUTF8 [6]
 
static const char trailingBytesForUTF8 [256]
 
static const
DistanceErrorScaleArray_T 
K_DEFAULT_ERROR_SCALE
 

Typedef Documentation

typedef std::istreambuf_iterator<char> OPENTREP::base_iterator_t

Definition at line 27 of file BasParserTypes.hpp.

typedef boost::spirit::multi_pass<base_iterator_t> OPENTREP::iterator_t

Definition at line 28 of file BasParserTypes.hpp.

typedef boost::spirit::classic::position_iterator2<iterator_t> OPENTREP::pos_iterator_t

Definition at line 31 of file BasParserTypes.hpp.

typedef boost::spirit::qi::uint_parser<int, 10, 1, 1> OPENTREP::uint1_p_t

1-digit-integer parser

Definition at line 40 of file BasParserTypes.hpp.

typedef boost::spirit::qi::uint_parser<int, 10, 2, 2> OPENTREP::uint2_p_t

2-digit-integer parser

Definition at line 43 of file BasParserTypes.hpp.

typedef boost::spirit::qi::uint_parser<int, 10, 1, 2> OPENTREP::int1_2_p_t

Up-to-2-digit-integer parser

Definition at line 46 of file BasParserTypes.hpp.

typedef boost::spirit::qi::uint_parser<int, 10, 4, 4> OPENTREP::uint4_p_t

4-digit-integer parser

Definition at line 49 of file BasParserTypes.hpp.

typedef boost::spirit::qi::int_parser<int, 10, 1, 5> OPENTREP::int1_5_p_t

Up-to-5-digit-integer parser

Definition at line 52 of file BasParserTypes.hpp.

typedef boost::spirit::qi::int_parser<int, 10, 0, 5> OPENTREP::int0_5_p_t

Definition at line 53 of file BasParserTypes.hpp.

typedef boost::spirit::qi::uint_parser<int, 10, 1, 4> OPENTREP::uint1_4_p_t

Up-to-4-digit-integer parser

Definition at line 56 of file BasParserTypes.hpp.

typedef boost::spirit::qi::uint_parser<int, 10, 1, 9> OPENTREP::uint1_9_p_t

Up-to-9-digit-integer parser

Definition at line 59 of file BasParserTypes.hpp.

typedef boost::spirit::qi::uint_parser<int, 10, 0, 9> OPENTREP::uint0_9_p_t

Definition at line 60 of file BasParserTypes.hpp.

typedef boost::spirit::qi::uint_parser<hour_t, 10, 2, 2> OPENTREP::hour_p_t

Date & time element parsers

Definition at line 63 of file BasParserTypes.hpp.

typedef boost::spirit::qi::uint_parser<minute_t, 10, 2, 2> OPENTREP::minute_p_t

Definition at line 64 of file BasParserTypes.hpp.

typedef boost::spirit::qi::uint_parser<second_t, 10, 2, 2> OPENTREP::second_p_t

Definition at line 65 of file BasParserTypes.hpp.

typedef boost::spirit::qi::uint_parser<year_t, 10, 4, 4> OPENTREP::year_p_t

Definition at line 66 of file BasParserTypes.hpp.

typedef boost::spirit::qi::uint_parser<month_t, 10, 2, 2> OPENTREP::month_p_t

Definition at line 67 of file BasParserTypes.hpp.

typedef boost::spirit::qi::uint_parser<day_t, 10, 2, 2> OPENTREP::day_p_t

Definition at line 68 of file BasParserTypes.hpp.

typedef boost::spirit::qi::bool_parser<bool, short_bool_policies> OPENTREP::boolean_p_t

Definition at line 101 of file BasParserTypes.hpp.

typedef long unsigned int OPENTREP::u_int32_t

32-bit unsigned integer

Definition at line 16 of file UTF8Handler.cpp.

List of matching Xapian documents.

(STL) List of Xapian documents and their associated score board.

Definition at line 20 of file DocumentList.hpp.

A generic BOM is a pair of a BOM type (enumeration) and a BOM object pointer.

Definition at line 15 of file GenericBom.hpp.

typedef std::map<std::size_t, GenericBom_T> OPENTREP::GenericBomList_T

List of generic BOM objects.

Definition at line 22 of file GenericBom.hpp.

typedef std::multimap<std::string, Place*> OPENTREP::PlaceList_T

Definition at line 14 of file PlaceList.hpp.

typedef std::list<Place*> OPENTREP::PlaceOrderedList_T

Definition at line 21 of file PlaceList.hpp.

typedef std::pair<Xapian::Document, ScoreBoard> OPENTREP::XapianDocumentPair_T

Pair of a Xapian document and its associated score board.

Definition at line 23 of file Result.hpp.

typedef std::map<Xapian::docid, XapianDocumentPair_T> OPENTREP::DocumentMap_T

(STL) Map of Xapian documents and their associated score board.

Definition at line 40 of file Result.hpp.

List of ResultHolder objects.

Definition at line 13 of file ResultHolderList.hpp.

typedef std::list<Result*> OPENTREP::ResultList_T

List of Result objects.

Definition at line 13 of file ResultList.hpp.

Type gathering all the partitions of a string.

Definition at line 166 of file StringPartition.hpp.

typedef std::size_t OPENTREP::WorldID_T

Definition at line 92 of file World.hpp.

typedef std::list<std::string> OPENTREP::DBParamsNameList_T

List of names for a given (geographical) dbparams.

Definition at line 19 of file DBParams.hpp.

typedef std::list<Location> OPENTREP::LocationList_T

List of (geographical) location structures.

Definition at line 13 of file LocationList.hpp.

typedef std::list<std::string> OPENTREP::NameList_T

Definition at line 20 of file Names.hpp.

Matrix of place names: for each of the language, the place gets a corresponding list of names.

For instance, MUC corresponds to Munich in English, München in German, Munique in French, Мюнхен in Russian, etc.

Definition at line 149 of file Names.hpp.

Type definitions for the date and time elements.

Definition at line 60 of file OPENTREP_ParserHelperTypes.hpp.

Definition at line 61 of file OPENTREP_ParserHelperTypes.hpp.

Definition at line 62 of file OPENTREP_ParserHelperTypes.hpp.

typedef date_time_element<1900, 2100> OPENTREP::year_t

Definition at line 63 of file OPENTREP_ParserHelperTypes.hpp.

Definition at line 64 of file OPENTREP_ParserHelperTypes.hpp.

Definition at line 65 of file OPENTREP_ParserHelperTypes.hpp.

Geonames ID.

Definition at line 91 of file OPENTREP_Types.hpp.

Envelope ID.

Definition at line 96 of file OPENTREP_Types.hpp.

Definition at line 145 of file OPENTREP_Types.hpp.

Definition at line 157 of file OPENTREP_Types.hpp.

Definition at line 349 of file OPENTREP_Types.hpp.

typedef double OPENTREP::GeoCoord_T

Geographical coordinate (e.g., -10.45 or 56.7).

Definition at line 354 of file OPENTREP_Types.hpp.

Definition at line 355 of file OPENTREP_Types.hpp.

Definition at line 356 of file OPENTREP_Types.hpp.

typedef boost::gregorian::date OPENTREP::Date_T

Date (e.g., modification date).

Definition at line 369 of file OPENTREP_Types.hpp.

typedef unsigned int OPENTREP::Population_T

Population (e.g., 400,000).

Definition at line 374 of file OPENTREP_Types.hpp.

typedef int OPENTREP::Elevation_T

Geographical elevation (e.g., 300).

Definition at line 379 of file OPENTREP_Types.hpp.

typedef int OPENTREP::GTopo30_T

Geographical topology 30.

Definition at line 384 of file OPENTREP_Types.hpp.

typedef double OPENTREP::PageRank_T

PageRank (e.g., 94.66%).

Definition at line 397 of file OPENTREP_Types.hpp.

Xapian document ID.

Definition at line 402 of file OPENTREP_Types.hpp.

typedef float OPENTREP::GMTOffset_T

GMT offset (e.g., 1)

Definition at line 407 of file OPENTREP_Types.hpp.

typedef float OPENTREP::DSTOffset_T

DST offset (e.g., 2)

Definition at line 412 of file OPENTREP_Types.hpp.

typedef float OPENTREP::RawOffset_T

Raw offset (e.g., 1)

Definition at line 417 of file OPENTREP_Types.hpp.

typedef bool OPENTREP::IsGeonames_T

Whether or not that POR is referenced by Geonames

Definition at line 422 of file OPENTREP_Types.hpp.

typedef bool OPENTREP::IsAirport_T

Whether or not that POR is an airport

Definition at line 427 of file OPENTREP_Types.hpp.

Whether or not that POR is for commercial use

Definition at line 432 of file OPENTREP_Types.hpp.

typedef unsigned short OPENTREP::Weight_T

Weight when indexing terms of a Xapian document.

Definition at line 438 of file OPENTREP_Types.hpp.

typedef std::string OPENTREP::TravelQuery_T

Travel search query.

Definition at line 443 of file OPENTREP_Types.hpp.

Xapian percentage.

Definition at line 448 of file OPENTREP_Types.hpp.

typedef double OPENTREP::Percentage_T

Matching percentage for a Xapian document.

Definition at line 453 of file OPENTREP_Types.hpp.

typedef double OPENTREP::Score_T

Score (e.g., matching percentage) for a document/POR (point of reference).

Definition at line 458 of file OPENTREP_Types.hpp.

typedef unsigned int OPENTREP::NbOfDBEntries_T

Number of entries in the Xapian database.

Definition at line 463 of file OPENTREP_Types.hpp.

typedef std::string OPENTREP::Word_T

Word, which is the atomic element of a query string.

Definition at line 468 of file OPENTREP_Types.hpp.

typedef std::list<Word_T> OPENTREP::WordList_T

List of words.

Definition at line 473 of file OPENTREP_Types.hpp.

typedef std::set<std::string> OPENTREP::WordSet_T

Set of words.

Definition at line 478 of file OPENTREP_Types.hpp.

typedef std::set<std::string> OPENTREP::BlackList_T

List of (black-listed) words.

Definition at line 483 of file OPENTREP_Types.hpp.

typedef unsigned int OPENTREP::NbOfLetters_T

Number of letters in a word or phrase.

Definition at line 488 of file OPENTREP_Types.hpp.

typedef unsigned short OPENTREP::NbOfWords_T

Number of words in a list.

Definition at line 493 of file OPENTREP_Types.hpp.

typedef unsigned short OPENTREP::NbOfMatches_T

Number of matching documents.

Definition at line 498 of file OPENTREP_Types.hpp.

typedef unsigned short OPENTREP::NbOfErrors_T

Number of errors.

Definition at line 503 of file OPENTREP_Types.hpp.

Number of (distance) errors allowed for a given number of letters.

Definition at line 508 of file OPENTREP_Types.hpp.

Number of (distance) errors allowed for a given number of letters.

Definition at line 513 of file OPENTREP_Types.hpp.

Function Documentation

const std::string OPENTREP::DEFAULT_OPENTREP_POR_FILEPATH ( OPENTREP_POR_DATA_DIR"/ori_por_public.csv"  )

Default file-path for the ORI-maintained POR (points of reference) file.

const std::string OPENTREP::DEFAULT_OPENTREP_XAPIAN_DB_FILEPATH ( "/tmp/opentrep/traveldb"  )

Default file-path for the Xapian database/index.

const std::string OPENTREP::DEFAULT_OPENTREP_MYSQL_DB_USER ( "geo"  )

Default name and location for the MySQL database (if existing).

const std::string OPENTREP::DEFAULT_OPENTREP_MYSQL_DB_PASSWD ( "geo"  )
const std::string OPENTREP::DEFAULT_OPENTREP_MYSQL_DB_DBNAME ( "geo_ori"  )
const std::string OPENTREP::DEFAULT_OPENTREP_MYSQL_DB_HOST ( "localhost"  )
const std::string OPENTREP::DEFAULT_OPENTREP_MYSQL_DB_PORT ( "3306"  )
const std::string OPENTREP::DEFAULT_OPENTREP_SQLITE_DB_FILEPATH ( OPENTREP_POR_DATA_DIR"/ori_por_public.db"  )

Default name and location for the SQLite3 database.

const std::string OPENTREP::DEFAULT_DATE_STR ( "1970-01-01"  )

Default date-time with std::string as type.

const NbOfMatches_T OPENTREP::K_DEFAULT_XAPIAN_MATCHING_SET_SIZE ( 30  )

Default size of matching set for Xapian (e.g., 30)

const Weight_T OPENTREP::K_DEFAULT_INDEXING_STD_WEIGHT ( )

Default indexing weight for standard terms (e.g., 1)

const Weight_T OPENTREP::K_DEFAULT_INDEXING_EXTRA_WEIGHT ( )

Default indexing weight for some terms like IATA/ICAO/FAA codes (e.g., 2)

const Percentage_T OPENTREP::K_DEFAULT_MODIFIED_MATCHING_PCT ( 100.  0)

Default modified matching percentage (e.g., 99.999% == 0.99999)

const Percentage_T OPENTREP::K_DEFAULT_PAGE_RANK ( 0.  10)

Default PageRank (e.g., 0.10% == 0.001)

const Percentage_T OPENTREP::K_DEFAULT_ENVELOPE_PCT ( K_DEFAULT_PAGE_RANK  )

Default envelope percentage (e.g., 0.10% == 0.001). Usually equal to K_DEFAULT_PAGE_RANK.

const Percentage_T OPENTREP::K_DEFAULT_FULL_CODE_MATCH_PCT ( 11000/  K_DEFAULT_PAGE_RANK)

Default full match percentage for a IATA/ICAO code (e.g., 11,000,000% == 110,000 == 110 / 0.001). Usually equal to 100 * 1.1 / (K_DEFAULT_PAGE_RANK / 100).

const Percentage_T OPENTREP::K_DEFAULT_ATTENUATION_FCTR ( 34.  0)

Default attenuation factor (e.g., 34.0)

const NbOfErrors_T OPENTREP::K_DEFAULT_SIZE_FOR_SPELLING_ERROR_UNIT ( )

Default number of characters by allowable spelling error unit

bool OPENTREP::check ( const UErrorCode &  iStatus,
const char *  iMsg 
)

Verify that the given status corresponds to a successful operation.

Parameters
constUErrorCode& The status of the last Unicode operation
constchar* Error message
Returns
bool Whether or not the operation was successful

Definition at line 18 of file icu_util.cpp.

References OPENTREP_LOG_ERROR.

UnicodeString& OPENTREP::appendHex ( const uint32_t  iNumber,
int8_t  ioDigits,
UnicodeString &  ioTarget 
)

Definition at line 34 of file icu_util.cpp.

Referenced by escape().

UnicodeString OPENTREP::escape ( const UnicodeString &  )

Replace non-printable characters with Unicode escapes.

Parameters
constUnicodeString& ICU Unicode string
Returns
UnicodeString ICU Unicode string with escaped characters

Definition at line 45 of file icu_util.cpp.

References appendHex().

std::string OPENTREP::getUTF8 ( const UnicodeString &  )

Get a STL string from the given UnicodeString.

Parameters
constUnicodeString& ICU Unicode string
Returns
std::string STL string

Definition at line 65 of file icu_util.cpp.

Referenced by OPENTREP::OTransliterator::normalise().

void OPENTREP::tokeniseStringIntoWordList ( const std::string &  iPhrase,
WordList_T  
)

Split a string into a list of tokens.

Definition at line 16 of file Utilities.cpp.

Referenced by OPENTREP::Place::addNameToXapianSets(), and OPENTREP::Filter::trim().

std::string OPENTREP::createStringFromWordList ( const WordList_T ,
const unsigned short  iSplitIdx = 0,
const bool  iFromBeginningFlag = true 
)

Create a string from a list of words.

The string is made of the words up until a given index. The default value of that index (0) means that the string will be made by all the words of the list.

If the flag is set to false, the string is made of the words from the given index up until the end of the list.

Definition at line 38 of file Utilities.cpp.

Referenced by OPENTREP::Place::addNameToXapianSets(), and OPENTREP::Filter::trim().

bool OPENTREP::hasGoodSize ( const std::string &  iWord,
const NbOfLetters_T &  iMinWordLength 
)

Helper function to check whether the word should be kept.

If the word has no more than <iMinWordLength> letters (e.g., 'de', 'san'), it should be filtered out. Indeed, when 'san' is part of 'san francisco', for instance, it should not be indexed/searched alone (in a search, the resulting match score will be zero).

Definition at line 39 of file Filter.cpp.

Referenced by ltrim(), rtrim(), and OPENTREP::Filter::shouldKeep().

bool OPENTREP::isBlackListed ( const std::string &  iWord)

Helper function to check whether the given word is black-listed.

Definition at line 53 of file Filter.cpp.

References K_BLACK_LIST.

Referenced by ltrim(), rtrim(), and OPENTREP::Filter::shouldKeep().

void OPENTREP::rtrim ( WordList_T ioWordList,
const NbOfLetters_T &  iMinWordLength 
)

Helper function to trim the non-relevant right outer words.

Definition at line 72 of file Filter.cpp.

References hasGoodSize(), and isBlackListed().

Referenced by trim().

void OPENTREP::ltrim ( WordList_T ioWordList,
const NbOfLetters_T &  iMinWordLength 
)

Helper function to trim the non-relevant left outer words.

Definition at line 97 of file Filter.cpp.

References hasGoodSize(), and isBlackListed().

Referenced by trim().

void OPENTREP::trim ( WordList_T ioWordList,
const NbOfLetters_T &  iMinWordLength 
)

Helper function to trim the non-relevant left and right outer words.

Definition at line 122 of file Filter.cpp.

References ltrim(), and rtrim().

Referenced by OPENTREP::Filter::trim().

static unsigned int OPENTREP::calculateEditDistance ( const TravelQuery_T &  iPhrase)
static

Helper function.

Given the size of the phrase, determine the allowed edit distance for spelling purpose. For instance, if K_DEFAULT_SIZE_FOR_SPELLING_ERROR_UNIT is equal to 4:

  • An edit distance of 1 will be allowed on a 4-letter word
  • While an edit distance of 3 will be allowed on an 11-letter word.

Definition at line 108 of file QuerySlices.cpp.

References K_DEFAULT_SIZE_FOR_SPELLING_ERROR_UNIT.

Referenced by doesMatch().

bool OPENTREP::doesMatch ( const Xapian::Database &  iDatabase,
const std::string &  iWord1,
const std::string &  iWord2 
)

Helper function to query for a Xapian-based full text match.

Definition at line 121 of file QuerySlices.cpp.

References calculateEditDistance(), OPENTREP::Levenshtein::getDistance(), and OPENTREP_LOG_ERROR.

static unsigned int OPENTREP::calculateEditDistance ( const TravelQuery_T &  iPhrase)
static

Helper function.

Given the size of the phrase, determine the allowed edit distance for spelling purpose. For instance, if K_DEFAULT_SIZE_FOR_SPELLING_ERROR_UNIT is equal to 4:

  • An edit distance of 1 will be allowed on a 4-letter word
  • While an edit distance of 3 will be allowed on an 11-letter word.

Definition at line 242 of file Result.cpp.

References K_DEFAULT_SIZE_FOR_SPELLING_ERROR_UNIT.

static const boost::char_separator<char> OPENTREP::AllSepatorList ( .,
;:|+-*/  _ = !@#$%`~^&(){}[]?'<>\"" 
)
static
static const boost::char_separator<char> OPENTREP::DocSepatorList ( ,
-%"   
)
static
void OPENTREP::baseTokeniseStringIntoWordList ( const std::string &  iPhrase,
WordList_T ioWordList,
const boost::char_separator< char > &  iSepatorList 
)
void OPENTREP::addToXapian ( const Place &  iPlace,
Xapian::Document &  ioDocument,
Xapian::WritableDatabase &  ioDatabase 
)
void OPENTREP::addUnmatchedWord ( const TravelQuery_T &  iQueryString,
WordList_T ioWordList,
WordSet_T &  ioWordSet 
)

Helper function to add the given string to the list of unknown words, only when that given string is made of a single word. Otherwise, the given string is simply ignored.

Parameters
constTravelQuery_T& The given string
WordList_T&ioWordList The list to which the given single-word string should be added (if needed).
WordSet_T&A (STL) set of words, allowing to keep track of the already added words.

Definition at line 44 of file RequestInterpreter.cpp.

References OPENTREP::Filter::shouldKeep(), and OPENTREP::WordHolder::tokeniseStringIntoWordList().

Referenced by searchString().

void OPENTREP::searchString ( const StringPartition &  iStringPartition,
const Xapian::Database &  iDatabase,
ResultCombination &  ioResultCombination,
WordList_T ioWordList 
)

For all the elements (StringSet) of the string partitions, derived from the given travel query, perform a Xapian-based full-text match. Each Xapian-based full-text match gives (potentially) a full set of matches, some with the highest matching percentage and some with a lower percentage.

Parameters
TravelQuery_T&The query string.
constXapian::Database& The Xapian index/database.
ResultCombination&List of ResultHolder objects.
WordList_T&List of non-matched words of the query string.

Definition at line 125 of file RequestInterpreter.cpp.

References OPENTREP::StringPartition::_partition, OPENTREP::StringSet::_set, addUnmatchedWord(), OPENTREP::FacResultHolder::create(), OPENTREP::FacResult::create(), OPENTREP::StringSet::describe(), OPENTREP::Result::fullTextMatch(), OPENTREP::FacResultHolder::initLinkWithResult(), OPENTREP::FacResultCombination::initLinkWithResultHolder(), OPENTREP::FacResult::instance(), OPENTREP::FacResultHolder::instance(), OPENTREP_LOG_DEBUG, OPENTREP_LOG_ERROR, and OPENTREP::ResultHolder::toString().

void OPENTREP::chooseBestMatchingResultHolder ( ResultCombination &  ioResultCombination)

Select the best matching string partition, based on the results of several rules, that are all materialised by weighting percentages:

  • Xapian-based full-text match. Score type: XAPIAN_PCT
  • Schedule-derived PageRank for the point of reference (POR). Score type: PAGE_RANK
  • Heuristic. Score type: Heuristic
See Also
ScoreType.hpp for the various types of score.

The score for the combination (score type: COMBINATION) is simply the product of all the scores/weighting percentages.

Parameters
ResultCombination&List of ResultHolder objects.

Definition at line 220 of file RequestInterpreter.cpp.

References OPENTREP::ResultCombination::chooseBestMatchingResultHolder(), OPENTREP::ResultHolder::describeShortKey(), OPENTREP::ResultCombination::describeShortKey(), OPENTREP::ResultCombination::getBestMatchingResultHolder(), OPENTREP::ResultCombination::getBestMatchingWeight(), OPENTREP::ResultCombination::getCorrectedStringSet(), and OPENTREP_LOG_DEBUG.

boost::filesystem::path OPENTREP::checkTravelDBFilePath ( const TravelDBFilePath_T &  iTravelDBFilePath)

Definition at line 26 of file XapianIndexManager.cpp.

References OPENTREP_LOG_ERROR.

template<int MIN, int MAX>
date_time_element<MIN, MAX> OPENTREP::operator* ( const date_time_element< MIN, MAX > &  o1,
const date_time_element< MIN, MAX > &  o2 
)
inline

Operator* overload.

Definition at line 46 of file OPENTREP_ParserHelperTypes.hpp.

References OPENTREP::date_time_element< MIN, MAX >::_value.

template<int MIN, int MAX>
date_time_element<MIN, MAX> OPENTREP::operator+ ( const date_time_element< MIN, MAX > &  o1,
const date_time_element< MIN, MAX > &  o2 
)
inline

Operator+ overload.

Definition at line 54 of file OPENTREP_ParserHelperTypes.hpp.

References OPENTREP::date_time_element< MIN, MAX >::_value.

void OPENTREP::logInit ( const LOG::EN_LogLevel  iLogLevel,
std::ostream &  ioLogOutputFile 
)

Variable Documentation

const std::tm OPENTREP::DEFAULT_DATE_TM
Initial value:
=
boost::gregorian::to_tm (Date_T (1970, boost::gregorian::Jan, 01))
boost::gregorian::date Date_T

Default date-time with std::tm structure as type.

Default std::tm (date-time) structure (e.g., 1970-JAN-01).

Definition at line 42 of file BasConst.cpp.

const char * OPENTREP::K_ICU_ACCENT_REMOVAL_RULE = "NFD; [:M:] Remove; NFC;"

Default Unicode transliterator rule (e.g., "NFD; [:M:] Remove; NFC;")

Default Unicode transliterator rule for the removal of accents (e.g., "NFD; [:M:] Remove; NFC;").

Definition at line 54 of file BasConst.cpp.

const char * OPENTREP::K_ICU_QUOTATION_REMOVAL_RULE
Initial value:
=
"[\\u02B9] > \\u0027; [\\u002D] > \\u0020; [\\u0027] > \\u0020;"

Default Unicode transliterator rule for the removal of quotes (e.g., "[\\u02B9] > \\u0027; [\\u002D] > \\u0020;")

Definition at line 60 of file BasConst.cpp.

const char * OPENTREP::K_ICU_PUNCTUATION_REMOVAL_RULE = "[:P:] Remove;"

Default Unicode transliterator rule for the removal of punctuation (e.g., "[:P:] Remove;")

Definition at line 67 of file BasConst.cpp.

const char * OPENTREP::K_ICU_GENERIC_TRANSLITERATOR_RULE
Initial value:
=
"Any-Latin; NFD; [:M:] Remove; NFC; Lower;"

Default Unicode transliterator rule for the removal of punctuation (e.g., "Any-Latin;")

Definition at line 73 of file BasConst.cpp.

const BlackList_T OPENTREP::K_BLACK_LIST = ListGenerator::createBlackList()

Black list, i.e., a list of words which should not be indexed and/or searched for (e.g., "airport", "international").

Definition at line 130 of file BasConst.cpp.

Referenced by isBlackListed().

const NbOfMatches_T OPENTREP::K_DEFAULT_XAPIAN_MATCHING_SET_SIZE

Default size of matching set for Xapian (e.g., 30)

const Weight_T OPENTREP::K_DEFAULT_INDEXING_STD_WEIGHT

Default indexing weight for standard terms (e.g., 1)

Referenced by OPENTREP::Place::buildIndexSets().

const Weight_T OPENTREP::K_DEFAULT_INDEXING_EXTRA_WEIGHT

Default indexing weight for some terms like IATA/ICAO/FAA codes (e.g., 2)

Referenced by OPENTREP::Place::buildIndexSets().

const Percentage_T OPENTREP::K_DEFAULT_MODIFIED_MATCHING_PCT

Default modified matching percentage (e.g., 99.999% == 0.99999)

Referenced by OPENTREP::Result::calculateCodeMatches(), and OPENTREP::ScoreBoard::setScore().

const Percentage_T OPENTREP::K_DEFAULT_PAGE_RANK

Default PageRank (e.g., 0.10% == 0.001)

Referenced by soci::type_conversion< OPENTREP::Place >::from_base().

const Percentage_T OPENTREP::K_DEFAULT_ENVELOPE_PCT

Default envelope percentage (e.g., 0.10% == 0.001). Usually equal to K_DEFAULT_PAGE_RANK.

Referenced by OPENTREP::ScoreBoard::setScore().

const Percentage_T OPENTREP::K_DEFAULT_FULL_CODE_MATCH_PCT

Default full match percentage for a IATA/ICAO code (e.g., 11,000,000% == 110,000 == 110 / 0.001). Usually equal to 100 * 1.1 / (K_DEFAULT_PAGE_RANK / 100).

Referenced by OPENTREP::Result::calculateCodeMatches(), and OPENTREP::ScoreBoard::setScore().

const Percentage_T OPENTREP::K_DEFAULT_ATTENUATION_FCTR

Default attenuation factor (e.g., 34.0)

Referenced by OPENTREP::ResultHolder::calculateCombinedWeights().

const NbOfErrors_T OPENTREP::K_DEFAULT_SIZE_FOR_SPELLING_ERROR_UNIT

Default number of characters by allowable spelling error unit

Referenced by calculateEditDistance().

const std::string OPENTREP::DEFAULT_DATE_STR

Default date-time with std::string as type (e.g., "1970-01-01").

Referenced by soci::type_conversion< OPENTREP::Place >::from_base().

const std::string OPENTREP::DEFAULT_OPENTREP_POR_FILEPATH

Default file-path for the ORI-maintained POR (points of reference) file.

Usually, the default file-path on Linux/Unix is <installation directory>="">/share/opentrep/data/ori_por_public.csv where <installation directory>=""> may be:

  • /usr when installed as root (e.g., with the RPM)
  • $HOME/dev/deliveries/opentrep-<version>

Referenced by readConfiguration().

const std::string OPENTREP::DEFAULT_OPENTREP_XAPIAN_DB_FILEPATH

Default file-path for the Xapian database/index.

Usually, the default file-path on Linux/Unix is /tmp/opentrep/traveldb

Referenced by readConfiguration().

const std::string OPENTREP::DEFAULT_OPENTREP_MYSQL_DB_USER

Default name and location for the MySQL database (if existing; currently, it does not).

Usually, the default MySQL database details are:

  • User: geo
  • Passwd: geo
  • DB name: geo_ori
  • Server hostname: localhost
  • Server port: 3306
const std::string OPENTREP::DEFAULT_OPENTREP_MYSQL_DB_PASSWD
const std::string OPENTREP::DEFAULT_OPENTREP_MYSQL_DB_DBNAME
const std::string OPENTREP::DEFAULT_OPENTREP_MYSQL_DB_HOST
const std::string OPENTREP::DEFAULT_OPENTREP_MYSQL_DB_PORT
const std::string OPENTREP::DEFAULT_OPENTREP_SQLITE_DB_FILEPATH

Default name and location for the SQLite3 database.

Usually, the default file-path on Linux/Unix is <installation directory>="">/share/opentrep/data/ori_por_public.db where <installation directory>=""> may be:

  • /usr when installed as root (e.g., with the RPM)
  • $HOME/dev/deliveries/opentrep-<version>

Referenced by readConfiguration().

const u_int32_t OPENTREP::offsetsFromUTF8[6]
static
Initial value:
= {
0x00000000UL, 0x00003080UL, 0x000E2080UL,
0x03C82080UL, 0xFA082080UL, 0x82082080UL
}

Definition at line 19 of file UTF8Handler.cpp.

Referenced by OPENTREP::UTF8Handler::toWideString().

const char OPENTREP::trailingBytesForUTF8[256]
static
Initial value:
= {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5
}

Definition at line 25 of file UTF8Handler.cpp.

Referenced by OPENTREP::UTF8Handler::toWideString().

const DistanceErrorScaleArray_T OPENTREP::K_DEFAULT_ERROR_SCALE
static
Initial value:
=
{ {3, 6, 9, 14, 19} }

Default distance error scale.

Allowed error for a given number of letters:

  • < 4 => 0
  • < 7 => 1
  • < 10 => 2
  • < 15 => 3
  • < 20 => 4
  • >= 20 => (nb of letters) / 5

Definition at line 35 of file DistanceErrorRule.hpp.