1 /*
2  * Copyright (C) 2008-2012  OMRON SOFTWARE Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package jp.co.omronsoft.openwnn;
18 
19 /**
20  * The container class of a word.
21  *
22  * @author Copyright (C) 2008-2009, OMRON SOFTWARE CO., LTD.  All Rights Reserved.
23  */
24 public class WnnWord {
25     /** The word's Id */
26     public int      id;
27     /** The string of this word. */
28     public String   candidate;
29     /** The reading of this word. */
30     public String   stroke;
31     /** The score of this word. */
32     public int      frequency;
33     /** The part of speech this word. */
34     public WnnPOS   partOfSpeech;
35     /** The attribute of this word when it is assumed a candidate. */
36     public int      attribute;
37 
38     /**
39      * Constructor
40      */
WnnWord()41     public WnnWord() {
42         this(0, "", "", new WnnPOS(), 0, 0);
43     }
44 
45     /**
46      * Constructor
47      *
48      * @param candidate     The string of word
49      * @param stroke        The reading of word
50      */
WnnWord(String candidate, String stroke)51     public WnnWord(String candidate, String stroke) {
52         this(0, candidate, stroke, new WnnPOS(), 0, 0);
53     }
54 
55     /**
56      * Constructor
57      *
58      * @param candidate     The string of word
59      * @param stroke        The reading of word
60      * @param frequency     The score of word
61      */
WnnWord(String candidate, String stroke, int frequency)62     public WnnWord(String candidate, String stroke, int frequency) {
63         this(0, candidate, stroke, new WnnPOS(), frequency, 0);
64     }
65 
66     /**
67      * Constructor
68      *
69      * @param candidate     The string of word
70      * @param stroke        The reading of word
71      * @param posTag        The part of speech of word
72      */
WnnWord(String candidate, String stroke, WnnPOS posTag)73     public WnnWord(String candidate, String stroke, WnnPOS posTag) {
74         this(0, candidate, stroke, posTag, 0, 0);
75     }
76 
77     /**
78      * Constructor
79      *
80      * @param candidate     The string of word
81      * @param stroke        The reading of word
82      * @param posTag        The part of speech of word
83      * @param frequency     The score of word
84      */
WnnWord(String candidate, String stroke, WnnPOS posTag, int frequency)85     public WnnWord(String candidate, String stroke, WnnPOS posTag, int frequency) {
86         this(0, candidate, stroke, posTag, frequency, 0);
87     }
88 
89     /**
90      * Constructor
91      *
92      * @param id            The ID of word
93      * @param candidate     The string of word
94      * @param stroke        The reading of word
95      * @param posTag        The part of speech of word
96      * @param frequency     The score of word
97      */
WnnWord(int id, String candidate, String stroke, WnnPOS posTag, int frequency)98     public WnnWord(int id, String candidate, String stroke, WnnPOS posTag, int frequency) {
99         this(id, candidate, stroke, posTag, frequency, 0);
100     }
101 
102     /**
103      * Constructor
104      *
105      * @param id            The ID of word
106      * @param candidate     The string of word
107      * @param stroke        The reading of word
108      * @param posTag        The part of speech of word
109      * @param frequency     The score of word
110      * @param attribute     The attribute of word
111      */
WnnWord(int id, String candidate, String stroke, WnnPOS posTag, int frequency, int attribute)112     public WnnWord(int id, String candidate, String stroke, WnnPOS posTag, int frequency, int attribute) {
113         this.id = id;
114         this.candidate = candidate;
115         this.stroke = stroke;
116         this.frequency = frequency;
117         this.partOfSpeech = posTag;
118         this.attribute = attribute;
119     }
120 }
121 
122