Download tools/mosesdecoder/moses/Syntax/F2S/RuleMatcherCallback.h from Quagmire1/wiki-cased: direct link, hf CLI and curl.
- Browser
- Download file 1.14 kB
-
https://huggingface.co/Quagmire1/wiki-cased/resolve/main/tools/mosesdecoder/moses/Syntax/F2S/RuleMatcherCallback.h
- Command line
-
hf download hf://Quagmire1/wiki-cased/tools/mosesdecoder/moses/Syntax/F2S/RuleMatcherCallback.h
-
curl -L -o RuleMatcherCallback.h https://huggingface.co/Quagmire1/wiki-cased/resolve/main/tools/mosesdecoder/moses/Syntax/F2S/RuleMatcherCallback.h
1.14 kB
| namespace Moses | |
| { | |
| namespace Syntax | |
| { | |
| namespace F2S | |
| { | |
| class RuleMatcherCallback | |
| { | |
| private: | |
| typedef BoundedPriorityContainer<SHyperedgeBundle> Container; | |
| public: | |
| RuleMatcherCallback(const PVertexToStackMap &stackMap, std::size_t ruleLimit) | |
| : m_stackMap(stackMap) | |
| , m_container(ruleLimit) {} | |
| void operator()(const PHyperedge &hyperedge) { | |
| PHyperedgeToSHyperedgeBundle(hyperedge, m_stackMap, m_tmpBundle); | |
| float score = SHyperedgeBundleScorer::Score(m_tmpBundle); | |
| m_container.SwapIn(m_tmpBundle, score); | |
| } | |
| void ClearContainer() { | |
| m_container.LazyClear(); | |
| } | |
| const Container &GetContainer() { | |
| return m_container; | |
| } | |
| private: | |
| const PVertexToStackMap &m_stackMap; | |
| SHyperedgeBundle m_tmpBundle; | |
| BoundedPriorityContainer<SHyperedgeBundle> m_container; | |
| }; | |
| } // F2S | |
| } // Syntax | |
| } // Moses | |