![]() |
LIMA
Libre Multilingual Analyzer — C++ API
|
#include <deeplima/token_sequence_analyzer.h>
Classes | |
| class | TokenIterator |
| class | enriched_token_t |
| class | enriched_token_buffer_t |
| struct | lemm_cache_key_hash |
Public Types | |
| typedef TokenIterator | output_iterator_t |
| Public Types inherited from deeplima::ITokenSequenceAnalyzer | |
| typedef std::function< void(std::shared_ptr< StringIndex > stridx, const token_buffer_t<> &tokens, const std::vector< StringIndex::idx_t > &lemmata, std::shared_ptr< StdMatrix< uint8_t > > classes, size_t begin, size_t end) > | output_callback_t |
Public Member Functions | |
| TokenSequenceAnalyzer () | |
| TokenSequenceAnalyzer (const std::string &model_fn, const std::string &lemm_model_fn, const std::string &lemm_dict_fn, const std::string &fixed_ini_fn, const std::string &lower_ini_fn, const std::string &fixed_lemm_fn, const std::string &lemm_rules_fn, const PathResolver &path_resolver, size_t buffer_size, size_t num_buffers) | |
| void | get_classes_from_fn (const std::string &fn, std::vector< std::string > &classes_names, std::vector< std::vector< std::string > > &classes) |
| virtual | ~TokenSequenceAnalyzer () |
| virtual void | register_handler (const output_callback_t fn) override |
| virtual const std::vector< std::vector< std::string > > & | get_classes () const override |
| virtual const std::vector< std::string > & | get_class_names () const override |
| virtual std::shared_ptr< StringIndex > | get_stridx () const override |
| virtual void | finalize () override |
| virtual void | operator() (const std::vector< deeplima::segmentation::token_pos > &tokens, uint32_t len) override |
Protected Types | |
| typedef std::pair< StringIndex::idx_t, morph_model::morph_feats_t > | lemm_cache_key_t |
Protected Member Functions | |
| void | acquire_buffer () |
| void | start_analysis (size_t buffer_idx, int count=-1) |
| void | process_buffer (size_t buffer_idx) |
| void | load_lemm_cache (const std::string &fn) |
| std::unordered_set< morph_model::morph_feats_t > | load_pos_cache (const std::string &fn) |
| void | load_lemm_rules (const std::string &fn) |
| Loads the edit rules (deeplima-gen-lemm-dict –rules) used for the words missing from the lemma dictionary. | |
| void | lemmatize (const token_buffer_t<> &buffer, std::vector< StringIndex::idx_t > &lemm_buffer, std::shared_ptr< StdMatrix< uint8_t > > classes, size_t offset, size_t end) |
| Lemmatizes buffer[0, end - offset). | |
Protected Attributes | |
| size_t | m_buffer_size |
| size_t | m_current_buffer |
| size_t | m_current_timepoint |
| std::shared_ptr< StringIndex > | m_stridx_ptr |
| StringIndex & | m_stridx |
| StringIndex::idx_t | m_unk_idx |
| std::vector< token_buffer_t<> > | m_buffers |
| std::vector< std::vector< StringIndex::idx_t > > | m_lemm_buffers |
| tagging::impl::TaggingImpl< TaggingAuxScalar > | m_cls |
| lemmatization::impl::LemmatizationImpl | m_lemm |
| std::shared_ptr< StdMatrix< uint8_t > > | m_classes |
| std::unordered_map< lemm_cache_key_t, StringIndex::idx_t, lemm_cache_key_hash > | m_lemm_cache |
| std::unordered_set< morph_model::morph_feats_t > | m_fixed_ini_cache |
| std::unordered_set< morph_model::morph_feats_t > | m_lower_ini_cache |
| std::unordered_set< morph_model::morph_feats_t > | m_fixed_lemm_cache |
| lemmatization::lemm_rules_t< morph_model::morph_feats_t > | m_lemm_rules |
| output_callback_t | m_output_callback |
Definition at line 81 of file token_sequence_analyzer.h.
|
protected |
Definition at line 561 of file token_sequence_analyzer.h.
| typedef TokenIterator deeplima::TokenSequenceAnalyzer< TaggingAuxScalar >::output_iterator_t |
Definition at line 206 of file token_sequence_analyzer.h.
|
inline |
Definition at line 297 of file token_sequence_analyzer.h.
|
inline |
Definition at line 307 of file token_sequence_analyzer.h.
|
inlinevirtual |
Definition at line 433 of file token_sequence_analyzer.h.
|
inlineprotected |
Definition at line 528 of file token_sequence_analyzer.h.
|
inlineoverridevirtual |
Implements deeplima::ITokenSequenceAnalyzer.
Definition at line 465 of file token_sequence_analyzer.h.
|
inlineoverridevirtual |
Implements deeplima::ITokenSequenceAnalyzer.
Definition at line 448 of file token_sequence_analyzer.h.
|
inlineoverridevirtual |
Implements deeplima::ITokenSequenceAnalyzer.
Definition at line 443 of file token_sequence_analyzer.h.
|
inline |
Definition at line 426 of file token_sequence_analyzer.h.
|
inlineoverridevirtual |
Implements deeplima::ITokenSequenceAnalyzer.
Definition at line 453 of file token_sequence_analyzer.h.
|
inlineprotected |
Lemmatizes buffer[0, end - offset).
Per word, the first that applies:
Definition at line 708 of file token_sequence_analyzer.h.
|
inlineprotected |
Definition at line 569 of file token_sequence_analyzer.h.
|
inlineprotected |
Loads the edit rules (deeplima-gen-lemm-dict –rules) used for the words missing from the lemma dictionary.
A rule whose UPOS or features the lemmatization model does not know could never match and is skipped.
Definition at line 657 of file token_sequence_analyzer.h.
|
inlineprotected |
Definition at line 626 of file token_sequence_analyzer.h.
|
inlineoverridevirtual |
Implements deeplima::ITokenSequenceAnalyzer.
Definition at line 487 of file token_sequence_analyzer.h.
|
inlineprotected |
Definition at line 555 of file token_sequence_analyzer.h.
|
inlineoverridevirtual |
Implements deeplima::ITokenSequenceAnalyzer.
Definition at line 437 of file token_sequence_analyzer.h.
|
inlineprotected |
Definition at line 545 of file token_sequence_analyzer.h.
|
protected |
Definition at line 764 of file token_sequence_analyzer.h.
|
protected |
Definition at line 771 of file token_sequence_analyzer.h.
|
protected |
Definition at line 776 of file token_sequence_analyzer.h.
|
protected |
Definition at line 774 of file token_sequence_analyzer.h.
|
protected |
Definition at line 765 of file token_sequence_analyzer.h.
|
protected |
Definition at line 766 of file token_sequence_analyzer.h.
|
protected |
Definition at line 783 of file token_sequence_analyzer.h.
|
protected |
Definition at line 785 of file token_sequence_analyzer.h.
|
protected |
Definition at line 775 of file token_sequence_analyzer.h.
|
protected |
Definition at line 772 of file token_sequence_analyzer.h.
|
protected |
Definition at line 778 of file token_sequence_analyzer.h.
|
protected |
Definition at line 786 of file token_sequence_analyzer.h.
|
protected |
Definition at line 784 of file token_sequence_analyzer.h.
|
protected |
Definition at line 788 of file token_sequence_analyzer.h.
|
protected |
Definition at line 769 of file token_sequence_analyzer.h.
|
protected |
Definition at line 768 of file token_sequence_analyzer.h.
|
protected |
Definition at line 770 of file token_sequence_analyzer.h.