mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-20 15:48:05 +03:00
modify DALMState to use the DALM compare function.
This commit is contained in:
parent
dbf90ce8e8
commit
da4e2719b2
@ -61,20 +61,7 @@ public:
|
|||||||
const DALMState &o = static_cast<const DALMState &>(other);
|
const DALMState &o = static_cast<const DALMState &>(other);
|
||||||
if(state->get_count() < o.state->get_count()) return -1;
|
if(state->get_count() < o.state->get_count()) return -1;
|
||||||
else if(state->get_count() > o.state->get_count()) return 1;
|
else if(state->get_count() > o.state->get_count()) return 1;
|
||||||
else{
|
else return state->compare(o.state);
|
||||||
// s->count==o.state->count;
|
|
||||||
unsigned short count = state->get_count();
|
|
||||||
for(size_t i = 0; i < count; i++){
|
|
||||||
DALM::VocabId w1 = state->get_word(i);
|
|
||||||
DALM::VocabId w2 = o.state->get_word(i);
|
|
||||||
if(w1 < w2){
|
|
||||||
return -1;
|
|
||||||
}else if(w1 > w2){
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DALM::State *get_state() const{
|
DALM::State *get_state() const{
|
||||||
|
Loading…
Reference in New Issue
Block a user