Download mosesdecoder/phrase-extract/extract-mixed-syntax/RuleSymbol.cpp from sleepyhead111/vllm_fairseq: direct link, hf CLI and curl.
- Browser
- Download file 572 Bytes
-
https://huggingface.co/sleepyhead111/vllm_fairseq/resolve/main/mosesdecoder/phrase-extract/extract-mixed-syntax/RuleSymbol.cpp
- Command line
-
hf download hf://sleepyhead111/vllm_fairseq/mosesdecoder/phrase-extract/extract-mixed-syntax/RuleSymbol.cpp
-
curl -L -o RuleSymbol.cpp https://huggingface.co/sleepyhead111/vllm_fairseq/resolve/main/mosesdecoder/phrase-extract/extract-mixed-syntax/RuleSymbol.cpp
572 Bytes
| /* | |
| * RuleSymbol.cpp | |
| * | |
| * Created on: 21 Feb 2014 | |
| * Author: hieu | |
| */ | |
| using namespace std; | |
| RuleSymbol::RuleSymbol() | |
| { | |
| // TODO Auto-generated constructor stub | |
| } | |
| RuleSymbol::~RuleSymbol() | |
| { | |
| // TODO Auto-generated destructor stub | |
| } | |
| int RuleSymbol::Compare(const RuleSymbol &other) const | |
| { | |
| if (IsNonTerm() != other.IsNonTerm()) { | |
| return IsNonTerm() ? -1 : +1; | |
| } | |
| string str = GetString(); | |
| string otherStr = other.GetString(); | |
| if (str == otherStr) { | |
| return 0; | |
| } else { | |
| return (str < otherStr) ? -1 : +1; | |
| } | |
| } | |