ddc
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CMorphAutomatBuilder Class Reference

#include <MorphAutomBuilder.h>

Inheritance diagram for CMorphAutomatBuilder:
Inheritance graph
[legend]
Collaboration diagram for CMorphAutomatBuilder:
Collaboration graph
[legend]

Public Member Functions

 CMorphAutomatBuilder (MorphLanguageEnum Language, BYTE AnnotChar)
 
 ~CMorphAutomatBuilder ()
 
void InitTrie ()
 
bool AddStringDaciuk (const string &WordForm)
 
void ClearRegister ()
 
void ConvertBuildRelationsToRelations ()
 
- Public Member Functions inherited from CMorphAutomat
 CMorphAutomat (MorphLanguageEnum Language, BYTE AnnotChar)
 
 ~CMorphAutomat ()
 
bool Load (string GrammarFileName)
 
bool Save (string GrammarFileName) const
 
bool DumpAllStrings (string FileName) const
 
void GetInnerMorphInfos (const string &Text, size_t TextPos, vector< CAutomAnnotationInner > &Infos) const
 
const CMorphAutomRelationGetChildren (size_t NodeNo) const
 
int NextNode (int NodeNo, BYTE Child) const
 
size_t GetChildrenCount (size_t NodeNo) const
 
const CMorphAutomNodeGetNode (int NodeNo) const
 
DWORD EncodeMorphAutomatInfo (size_t ModelNo, size_t ItemNo, size_t PrefixNo) const
 
void DecodeMorphAutomatInfo (DWORD Info, size_t &ModelNo, size_t &ItemNo, size_t &PrefixNo) const
 
string GetFirstResult (const string &Text) const
 
- Public Member Functions inherited from CABCEncoder
bool CheckABCWithAnnotator (const string &WordForm) const
 
bool CheckABCWithoutAnnotator (const string &WordForm) const
 
string EncodeIntToAlphabet (DWORD v) const
 
DWORD DecodeFromAlphabet (const string &v) const
 
string GetCriticalNounLetterPack () const
 
 CABCEncoder (MorphLanguageEnum Language, BYTE AnnotChar)
 

Private Member Functions

void ClearBuildNodes ()
 
CTrieNodeBuildCreateNode ()
 
void DeleteNode (CTrieNodeBuild *pNode)
 
CTrieNodeBuildCloneNode (const CTrieNodeBuild *pPrototype)
 
void UpdateCommonPrefix (const string &WordForm)
 
CTrieNodeBuildAddSuffix (CTrieNodeBuild *pParentNodeNo, const char *WordForm)
 
CTrieNodeBuildReplaceOrRegister (CTrieNodeBuild *pNode)
 
void DeleteFromRegister (CTrieNodeBuild *pNode)
 
int GetFirstConfluenceState () const
 
void UnregisterNode (CTrieNodeBuild *pNode)
 
CTrieRegisterGetRegister (const CTrieNodeBuild *pNode)
 
bool CheckRegister () const
 
bool IsValid () const
 

Private Attributes

CTrieNodeBuildm_pRoot
 
CTrieRegister m_RegisterHash [MaxAlphabetSize+1][MaxAlphabetSize+1]
 
vector< CTrieNodeBuild * > m_Prefix
 
vector< CTrieNodeBuild * > m_DeletedNodes
 

Additional Inherited Members

- Public Attributes inherited from CABCEncoder
MorphLanguageEnum m_Language
 
const BYTE m_AnnotChar
 
int m_AlphabetSize
 
int m_Alphabet2Code [256]
 
int m_Code2Alphabet [MaxAlphabetSize]
 
int m_AlphabetSizeWithoutAnnotator
 
int m_Alphabet2CodeWithoutAnnotator [256]
 
int m_Code2AlphabetWithoutAnnotator [MaxAlphabetSize]
 
- Protected Member Functions inherited from CMorphAutomat
void DumpAllStringsRecursive (FILE *fp, int NodeNo, string CurrPath) const
 
void BuildChildrenCache ()
 
void GetAllMorphInterpsRecursive (int NodeNo, string &curr_path, vector< CAutomAnnotationInner > &Infos) const
 
int FindStringAndPassAnnotChar (const string &Text, size_t TextPos) const
 
void Clear ()
 
- Protected Attributes inherited from CMorphAutomat
CMorphAutomNodem_pNodes
 
size_t m_NodesCount
 
CMorphAutomRelationm_pRelations
 
size_t m_RelationsCount
 
vector< int > m_ChildrenCache
 

Constructor & Destructor Documentation

◆ CMorphAutomatBuilder()

CMorphAutomatBuilder::CMorphAutomatBuilder ( MorphLanguageEnum  Language,
BYTE  AnnotChar 
)

References m_pRoot.

◆ ~CMorphAutomatBuilder()

CMorphAutomatBuilder::~CMorphAutomatBuilder ( )

References ClearBuildNodes().

Here is the call graph for this function:

Member Function Documentation

◆ ClearBuildNodes()

void CMorphAutomatBuilder::ClearBuildNodes ( )
private

References DeleteNode(), m_DeletedNodes, and m_pRoot.

Referenced by InitTrie(), and ~CMorphAutomatBuilder().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateNode()

CTrieNodeBuild * CMorphAutomatBuilder::CreateNode ( )
private

References CTrieNodeBuild::Initialize(), and m_DeletedNodes.

Referenced by AddSuffix(), CloneNode(), and InitTrie().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeleteNode()

void CMorphAutomatBuilder::DeleteNode ( CTrieNodeBuild pNode)
private

◆ CloneNode()

CTrieNodeBuild * CMorphAutomatBuilder::CloneNode ( const CTrieNodeBuild pPrototype)
private

copying children and incrementing m_IncomingRelationsCount

References CreateNode(), CTrieNodeBuild::m_bFinal, CTrieNodeBuild::m_bRegistered, CTrieNodeBuild::m_Children, CTrieNodeBuild::m_FirstChildNo, CTrieNodeBuild::m_IncomingRelationsCount, CTrieNodeBuild::m_SecondChildNo, MaxAlphabetSize, and CTrieNodeBuild::SetFinal().

Referenced by AddStringDaciuk().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateCommonPrefix()

void CMorphAutomatBuilder::UpdateCommonPrefix ( const string &  WordForm)
private

References CABCEncoder::m_Alphabet2Code, m_Prefix, and m_pRoot.

Referenced by AddStringDaciuk().

Here is the caller graph for this function:

◆ AddSuffix()

CTrieNodeBuild * CMorphAutomatBuilder::AddSuffix ( CTrieNodeBuild pParentNodeNo,
const char *  WordForm 
)
private

References CTrieNodeBuild::AddChild(), CreateNode(), CABCEncoder::m_Alphabet2Code, CTrieNodeBuild::m_bRegistered, ReplaceOrRegister(), and CTrieNodeBuild::SetFinal().

Referenced by AddStringDaciuk().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReplaceOrRegister()

CTrieNodeBuild * CMorphAutomatBuilder::ReplaceOrRegister ( CTrieNodeBuild pNode)
private

References DeleteNode(), GetRegister(), CTrieNodeBuild::m_bRegistered, CTrieNodeBuild::m_pRegister, and RegisterSize.

Referenced by AddStringDaciuk(), and AddSuffix().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeleteFromRegister()

void CMorphAutomatBuilder::DeleteFromRegister ( CTrieNodeBuild pNode)
private

◆ GetFirstConfluenceState()

int CMorphAutomatBuilder::GetFirstConfluenceState ( ) const
private

References m_Prefix.

Referenced by AddStringDaciuk().

Here is the caller graph for this function:

◆ UnregisterNode()

void CMorphAutomatBuilder::UnregisterNode ( CTrieNodeBuild pNode)
private

References GetRegister(), CTrieNodeBuild::m_bRegistered, CTrieNodeBuild::m_pRegister, and RegisterSize.

Referenced by AddStringDaciuk().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetRegister()

CTrieRegister & CMorphAutomatBuilder::GetRegister ( const CTrieNodeBuild pNode)
private

References CTrieNodeBuild::m_FirstChildNo, m_RegisterHash, CTrieNodeBuild::m_SecondChildNo, and MaxAlphabetSize.

Referenced by ReplaceOrRegister(), and UnregisterNode().

Here is the caller graph for this function:

◆ CheckRegister()

bool CMorphAutomatBuilder::CheckRegister ( ) const
private

References CheckRegisterOrder(), CTrieNodeBuild::CheckRegisterRecursive(), CTrieNodeBuild::m_bRegistered, CTrieNodeBuild::m_pRegister, m_pRoot, m_RegisterHash, and MaxAlphabetSize.

Referenced by IsValid().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsValid()

bool CMorphAutomatBuilder::IsValid ( ) const
private

◆ InitTrie()

void CMorphAutomatBuilder::InitTrie ( )

References ClearBuildNodes(), ClearRegister(), CreateNode(), and m_pRoot.

Referenced by CMorphDictBuilder::CreateAutomat(), and CMorphDictBuilder::GenPredictIdx().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddStringDaciuk()

bool CMorphAutomatBuilder::AddStringDaciuk ( const string &  WordForm)

◆ ClearRegister()

void CMorphAutomatBuilder::ClearRegister ( )

References m_pRoot, m_RegisterHash, MaxAlphabetSize, RegisterSize, and CTrieNodeBuild::UnregisterRecursive().

Referenced by CMorphDictBuilder::CreateAutomat(), and InitTrie().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConvertBuildRelationsToRelations()

void CMorphAutomatBuilder::ConvertBuildRelationsToRelations ( )

Member Data Documentation

◆ m_pRoot

CTrieNodeBuild* CMorphAutomatBuilder::m_pRoot
private

◆ m_RegisterHash

CTrieRegister CMorphAutomatBuilder::m_RegisterHash[MaxAlphabetSize+1][MaxAlphabetSize+1]
private

◆ m_Prefix

vector<CTrieNodeBuild*> CMorphAutomatBuilder::m_Prefix
private

◆ m_DeletedNodes

vector<CTrieNodeBuild*> CMorphAutomatBuilder::m_DeletedNodes
private

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