Download mosesdecoder/moses/Syntax/S2T/Parsers/Scope3Parser/Parser.h from sleepyhead111/vllm_fairseq: direct link, hf CLI and curl.
- Browser
- Download file 1.76 kB
-
https://huggingface.co/sleepyhead111/vllm_fairseq/resolve/main/mosesdecoder/moses/Syntax/S2T/Parsers/Scope3Parser/Parser.h
- Command line
-
hf download hf://sleepyhead111/vllm_fairseq/mosesdecoder/moses/Syntax/S2T/Parsers/Scope3Parser/Parser.h
-
curl -L -o Parser.h https://huggingface.co/sleepyhead111/vllm_fairseq/resolve/main/mosesdecoder/moses/Syntax/S2T/Parsers/Scope3Parser/Parser.h
1.76 kB
| namespace Moses | |
| { | |
| namespace Syntax | |
| { | |
| namespace S2T | |
| { | |
| // Parser that implements the algorithm described in this paper: | |
| // | |
| // Philip Williams and Philipp Koehn | |
| // "GHKM Rule Extraction and Scope-3 Parsing in Moses" | |
| // In proceedings of WMT 2012 | |
| // | |
| template<typename Callback> | |
| class Scope3Parser : public Parser<Callback> | |
| { | |
| public: | |
| typedef Parser<Callback> Base; | |
| typedef RuleTrieScope3 RuleTrie; | |
| // TODO Make this configurable? | |
| static bool RequiresCompressedChart() { | |
| return false; | |
| } | |
| Scope3Parser(PChart &, const RuleTrie &, std::size_t); | |
| ~Scope3Parser(); | |
| void EnumerateHyperedges(const Range &, Callback &); | |
| private: | |
| void Init(); | |
| void InitRuleApplicationVector(); | |
| void FillSentenceMap(SentenceMap &); | |
| void RecordPatternApplicationSpans(const PatternApplicationTrie &); | |
| PatternApplicationTrie *m_patRoot; | |
| std::vector<std::vector<bool> > m_quickCheckTable; | |
| const RuleTrie &m_ruleTable; | |
| const std::size_t m_maxChartSpan; | |
| TailLattice m_lattice; | |
| TailLatticeBuilder m_latticeBuilder; | |
| SymbolRangeCalculator m_symbolRangeCalculator; | |
| std::vector<SymbolRange> m_symbolRanges; | |
| PatternApplicationKey m_patKey; | |
| /* m_patSpans[i][j] records the set of all PAT nodes for span [i,i+j] | |
| i.e. j is the width of the span */ | |
| std::vector<std::vector< | |
| std::vector<const PatternApplicationTrie *> > > m_patSpans; | |
| }; | |
| } // namespace S2T | |
| } // namespace Syntax | |
| } // namespace Moses | |
| // Implementation | |