123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- /***********************************************************
- * File generated by the HALCON-Compiler hcomp version 20.11
- * Usage: Interface to C++
- *
- * Software by: MVTec Software GmbH, www.mvtec.com
- ***********************************************************/
- #ifndef HCPP_HLEXICON
- #define HCPP_HLEXICON
- namespace HalconCpp
- {
- // Represents an instance of a lexicon.
- class LIntExport HLexicon : public HHandle
- {
- public:
- // Create an uninitialized instance
- HLexicon():HHandle() {}
- // Copy constructor
- HLexicon(const HLexicon& source) : HHandle(source) {}
- // Copy constructor
- HLexicon(const HHandle& handle);
- // Create HLexicon from handle, taking ownership
- explicit HLexicon(Hlong handle);
- bool operator==(const HHandle& obj) const
- {
- return HHandleBase::operator==(obj);
- }
- bool operator!=(const HHandle& obj) const
- {
- return HHandleBase::operator!=(obj);
- }
- protected:
- // Verify matching semantic type ('lexicon')!
- virtual void AssertType(Hphandle handle) const;
- public:
- /*****************************************************************************
- * Operator-based class constructors
- *****************************************************************************/
- // import_lexicon: Create a lexicon from a text file.
- explicit HLexicon(const HString& Name, const HString& FileName);
- // import_lexicon: Create a lexicon from a text file.
- explicit HLexicon(const char* Name, const char* FileName);
- #ifdef _WIN32
- // import_lexicon: Create a lexicon from a text file.
- explicit HLexicon(const wchar_t* Name, const wchar_t* FileName);
- #endif
- // create_lexicon: Create a lexicon from a tuple of words.
- explicit HLexicon(const HString& Name, const HTuple& Words);
- // create_lexicon: Create a lexicon from a tuple of words.
- explicit HLexicon(const char* Name, const HTuple& Words);
- #ifdef _WIN32
- // create_lexicon: Create a lexicon from a tuple of words.
- explicit HLexicon(const wchar_t* Name, const HTuple& Words);
- #endif
- /***************************************************************************
- * Operators *
- ***************************************************************************/
- // Clear a lexicon.
- void ClearLexicon() const;
- // Find a similar word in a lexicon.
- HString SuggestLexicon(const HString& Word, Hlong* NumCorrections) const;
- // Find a similar word in a lexicon.
- HString SuggestLexicon(const char* Word, Hlong* NumCorrections) const;
- #ifdef _WIN32
- // Find a similar word in a lexicon.
- HString SuggestLexicon(const wchar_t* Word, Hlong* NumCorrections) const;
- #endif
- // Check if a word is contained in a lexicon.
- Hlong LookupLexicon(const HString& Word) const;
- // Check if a word is contained in a lexicon.
- Hlong LookupLexicon(const char* Word) const;
- #ifdef _WIN32
- // Check if a word is contained in a lexicon.
- Hlong LookupLexicon(const wchar_t* Word) const;
- #endif
- // Query all words from a lexicon.
- HTuple InspectLexicon() const;
- // Create a lexicon from a text file.
- void ImportLexicon(const HString& Name, const HString& FileName);
- // Create a lexicon from a text file.
- void ImportLexicon(const char* Name, const char* FileName);
- #ifdef _WIN32
- // Create a lexicon from a text file.
- void ImportLexicon(const wchar_t* Name, const wchar_t* FileName);
- #endif
- // Create a lexicon from a tuple of words.
- void CreateLexicon(const HString& Name, const HTuple& Words);
- // Create a lexicon from a tuple of words.
- void CreateLexicon(const char* Name, const HTuple& Words);
- #ifdef _WIN32
- // Create a lexicon from a tuple of words.
- void CreateLexicon(const wchar_t* Name, const HTuple& Words);
- #endif
- };
- // forward declarations and types for internal array implementation
- template<class T> class HSmartPtr;
- template<class T> class HHandleBaseArrayRef;
- typedef HHandleBaseArrayRef<HLexicon> HLexiconArrayRef;
- typedef HSmartPtr< HLexiconArrayRef > HLexiconArrayPtr;
- // Represents multiple tool instances
- class LIntExport HLexiconArray : public HHandleBaseArray
- {
- public:
- // Create empty array
- HLexiconArray();
- // Create array from native array of tool instances
- HLexiconArray(HLexicon* classes, Hlong length);
- // Copy constructor
- HLexiconArray(const HLexiconArray &tool_array);
- // Destructor
- virtual ~HLexiconArray();
- // Assignment operator
- HLexiconArray &operator=(const HLexiconArray &tool_array);
- // Clears array and all tool instances
- virtual void Clear();
- // Get array of native tool instances
- const HLexicon* Tools() const;
- // Get number of tools
- virtual Hlong Length() const;
- // Create tool array from tuple of handles
- virtual void SetFromTuple(const HTuple& handles);
- // Get tuple of handles for tool array
- virtual HTuple ConvertToTuple() const;
- protected:
- // Smart pointer to internal data container
- HLexiconArrayPtr *mArrayPtr;
- };
- }
- #endif
|