Download tools/mosesdecoder/moses/Syntax/CubeQueue.cpp from Quagmire1/wiki-cased: direct link, hf CLI and curl.
- Browser
- Download file 597 Bytes
-
https://huggingface.co/Quagmire1/wiki-cased/resolve/main/tools/mosesdecoder/moses/Syntax/CubeQueue.cpp
- Command line
-
hf download hf://Quagmire1/wiki-cased/tools/mosesdecoder/moses/Syntax/CubeQueue.cpp
-
curl -L -o CubeQueue.cpp https://huggingface.co/Quagmire1/wiki-cased/resolve/main/tools/mosesdecoder/moses/Syntax/CubeQueue.cpp
597 Bytes
| namespace Moses | |
| { | |
| namespace Syntax | |
| { | |
| CubeQueue::~CubeQueue() | |
| { | |
| while (!m_queue.empty()) { | |
| Cube *cube = m_queue.top(); | |
| m_queue.pop(); | |
| delete cube; | |
| } | |
| } | |
| SHyperedge *CubeQueue::Pop() | |
| { | |
| // pop the most promising cube | |
| Cube *cube = m_queue.top(); | |
| m_queue.pop(); | |
| // pop the most promising hyperedge from the cube | |
| SHyperedge *hyperedge = cube->Pop(); | |
| // if the cube contains more items then push it back onto the queue | |
| if (!cube->IsEmpty()) { | |
| m_queue.push(cube); | |
| } else { | |
| delete cube; | |
| } | |
| return hyperedge; | |
| } | |
| } // Syntax | |
| } // Moses | |