aboutsummaryrefslogtreecommitdiffstats
path: root/fsa/src/main/java/com/yahoo/fsa/segmenter/Segment.java
blob: b0589e71ee47d85dd63555aa4103e4c8050f7a06 (plain) (blame)
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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.fsa.segmenter;

/**
 * Class encapsulation of a segment.
 *
 * @author Peter Boros
 */
public class Segment {

    final int begin;
    final int end;
    final int conn;

    public Segment(int b, int e, int c) {
      begin = b;
      end = e;
      conn = c;
    }

    public int beg()
    {
      return begin;
    }

    public int end()
    {
      return end;
    }

    public int len()
    {
      return end - begin;
    }

    public int conn()
    {
      return conn;
    }

}