ClassesClassesClassesClasses | | | | Operators

import_lexiconimport_lexiconImportLexiconimport_lexiconImportLexiconImportLexicon (Operator)


import_lexiconimport_lexiconImportLexiconimport_lexiconImportLexiconImportLexicon — Create a lexicon from a text file.


import_lexicon( : : Name, FileName : LexiconHandle)

Herror import_lexicon(const char* Name, const char* FileName, Hlong* LexiconHandle)

Herror T_import_lexicon(const Htuple Name, const Htuple FileName, Htuple* LexiconHandle)

Herror import_lexicon(const HTuple& Name, const HTuple& FileName, Hlong* LexiconHandle)

void HLexicon::ImportLexicon(const HTuple& Name, const HTuple& FileName)

void ImportLexicon(const HTuple& Name, const HTuple& FileName, HTuple* LexiconHandle)

void HLexicon::HLexicon(const HString& Name, const HString& FileName)

void HLexicon::HLexicon(const char* Name, const char* FileName)

void HLexicon::ImportLexicon(const HString& Name, const HString& FileName)

void HLexicon::ImportLexicon(const char* Name, const char* FileName)

void HOperatorSetX.ImportLexicon(
[in] VARIANT Name, [in] VARIANT FileName, [out] VARIANT* LexiconHandle)

void HLexiconX.ImportLexicon(
[in] BSTR Name, [in] BSTR FileName)

static void HOperatorSet.ImportLexicon(HTuple name, HTuple fileName, out HTuple lexiconHandle)

public HLexicon(string name, string fileName)

void HLexicon.ImportLexicon(string name, string fileName)


import_lexiconimport_lexiconImportLexiconimport_lexiconImportLexiconImportLexicon creates a new lexicon based on a list of words in the file specified by FileNameFileNameFileNameFileNameFileNamefileName. The format of the file is a simple text file with one word per line. By specifying a unique textual NameNameNameNameNamename, you can later refer to the lexicon from syntax expressions like those used, e.g., by do_ocr_word_mlpdo_ocr_word_mlpDoOcrWordMlpdo_ocr_word_mlpDoOcrWordMlpDoOcrWordMlp.

Note that lexicon support in HALCON is currently not aimed at natural languages. Rather, it is intended as a post-processing step in OCR applications that only need to distinguish between a limited set of not more than a few thousand valid words, e.g., country or product names. MVTec itself does not provide any lexica.


This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.


NameNameNameNameNamename (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Unique name for the new lexicon.

Default value: 'lex1' "lex1" "lex1" "lex1" "lex1" "lex1"

FileNameFileNameFileNameFileNameFileNamefileName (input_control) HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Name of a text file containing words for the new lexicon.

Default value: 'words.txt' "words.txt" "words.txt" "words.txt" "words.txt" "words.txt"

File extension: .txt

LexiconHandleLexiconHandleLexiconHandleLexiconHandleLexiconHandlelexiconHandle (output_control)  lexicon HLexicon, HTupleHTupleHLexicon, HTupleHLexiconX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Handle of the lexicon.

Possible Successors

do_ocr_word_mlpdo_ocr_word_mlpDoOcrWordMlpdo_ocr_word_mlpDoOcrWordMlpDoOcrWordMlp, do_ocr_word_svmdo_ocr_word_svmDoOcrWordSvmdo_ocr_word_svmDoOcrWordSvmDoOcrWordSvm



See also

lookup_lexiconlookup_lexiconLookupLexiconlookup_lexiconLookupLexiconLookupLexicon, suggest_lexiconsuggest_lexiconSuggestLexiconsuggest_lexiconSuggestLexiconSuggestLexicon



ClassesClassesClassesClasses | | | | Operators