Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ug_corpus_token.cc « mm « UG « TranslationModel « moses - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4be8cbd95291e336a786885c7f7b704f567c7012 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "ug_corpus_token.h"
// Simple wrapper around integer IDs for use with the Ctrack and TSA template classes.
// (c) 2007-2009 Ulrich Germann

namespace ugdiss
{
  id_type const&
  SimpleWordId::
  id() const
  {
    return theID;
  }

  int
  SimpleWordId::
  cmp(SimpleWordId const& other) const
  {
    return (theID < other.theID    ? -1
            : theID == other.theID ?  0
            :                         1);
  }

  SimpleWordId::
  SimpleWordId(id_type const& id)
  {
    theID = id;
  }

  bool
  SimpleWordId::
  operator==(SimpleWordId const& other) const
  {
    return theID == other.theID;
  }

  id_type
  SimpleWordId::
  remap(vector<id_type const*> const& m) const
  {
    if (!m[0]) return theID;
    return m[0][theID];
  }

}