Download tools/mosesdecoder/moses2/TranslationModel/Dynamic/DynamicPhraseTable.h from Quagmire1/wiki-cased: direct link, hf CLI and curl.
- Browser
- Download file 2.45 kB
-
https://huggingface.co/Quagmire1/wiki-cased/resolve/main/tools/mosesdecoder/moses2/TranslationModel/Dynamic/DynamicPhraseTable.h
- Command line
-
hf download hf://Quagmire1/wiki-cased/tools/mosesdecoder/moses2/TranslationModel/Dynamic/DynamicPhraseTable.h
-
curl -L -o DynamicPhraseTable.h https://huggingface.co/Quagmire1/wiki-cased/resolve/main/tools/mosesdecoder/moses2/TranslationModel/Dynamic/DynamicPhraseTable.h
2.45 kB
| /* | |
| * MSPT.h | |
| * | |
| * Created on: 28 Oct 2015 | |
| * Author: hieu | |
| */ | |
| namespace Moses2 | |
| { | |
| class DynamicPhraseTable: public PhraseTable | |
| { | |
| typedef DynamicPhraseTableNS::Node<Word, Phrase<Word>, TargetPhraseImpl, TargetPhrases> PBNODE; | |
| typedef DynamicPhraseTableNS::Node<SCFG::Word, Phrase<SCFG::Word>, SCFG::TargetPhraseImpl, SCFG::TargetPhrases> SCFGNODE; | |
| ////////////////////////////////////// | |
| class ActiveChartEntryMem : public SCFG::ActiveChartEntry | |
| { | |
| typedef SCFG::ActiveChartEntry Parent; | |
| public: | |
| const DynamicPhraseTable::SCFGNODE &node; | |
| ActiveChartEntryMem(MemPool &pool, const DynamicPhraseTable::SCFGNODE &vnode) | |
| :Parent(pool) | |
| ,node(vnode) | |
| {} | |
| ActiveChartEntryMem( | |
| MemPool &pool, | |
| const DynamicPhraseTable::SCFGNODE &vnode, | |
| const ActiveChartEntry &prevEntry) | |
| :Parent(prevEntry) | |
| ,node(vnode) | |
| {} | |
| }; | |
| ////////////////////////////////////// | |
| public: | |
| DynamicPhraseTable(size_t startInd, const std::string &line); | |
| virtual ~DynamicPhraseTable(); | |
| virtual TargetPhrases *Lookup(const Manager &mgr, MemPool &pool, | |
| InputPath &inputPath) const; | |
| virtual void InitActiveChart( | |
| MemPool &pool, | |
| const SCFG::Manager &mgr, | |
| SCFG::InputPath &path) const; | |
| void Lookup(MemPool &pool, | |
| const SCFG::Manager &mgr, | |
| size_t maxChartSpan, | |
| const SCFG::Stacks &stacks, | |
| SCFG::InputPath &path) const; | |
| virtual void InitializeForInput(const ManagerBase &mgr, const InputType &input); | |
| virtual void CleanUpAfterSentenceProcessing(const System &system, const InputType &input) const; | |
| protected: | |
| thread_local static PBNODE m_rootPb; | |
| void LookupGivenNode( | |
| MemPool &pool, | |
| const SCFG::Manager &mgr, | |
| const SCFG::ActiveChartEntry &prevEntry, | |
| const SCFG::Word &wordSought, | |
| const Moses2::Hypotheses *hypos, | |
| const Moses2::Range &subPhraseRange, | |
| SCFG::InputPath &outPath) const; | |
| void CreatePTForInput(const ManagerBase &mgr, std::string phraseTableString); | |
| }; | |
| } | |