File size: 398 Bytes
1ce325b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "renumber.hh"
#include "ngram.hh"

#include "../../util/stream/stream.hh"

namespace lm {

void Renumber::Run(const util::stream::ChainPosition &position) {
  for (util::stream::Stream stream(position); stream; ++stream) {
    NGramHeader gram(stream.Get(), order_);
    for (WordIndex *w = gram.begin(); w != gram.end(); ++w) {
      *w = new_numbers_[*w];
    }
  }
}

} // namespace lm