Skip to content

Commit 6c30fd5

Browse files
committed
Fix typos in FeatureGeter.java
featrue -> feature
1 parent 1dd6320 commit 6c30fd5

File tree

3 files changed

+49
-49
lines changed

3 files changed

+49
-49
lines changed

fnlp-core/src/main/java/org/fnlp/nlp/cn/anaphora/ARInstanceGetter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class ARInstanceGetter {
3232

3333
private Instance instance;
3434
public ARInstanceGetter(FeatureGeter fBuilder){
35-
this.instance = new Instance(fBuilder.getFeatrue(),
35+
this.instance = new Instance(fBuilder.getFeature(),
3636
fBuilder.getInst().getTarget());
3737
this.instance.setSource(fBuilder.getInst().getData());
3838
}

fnlp-core/src/main/java/org/fnlp/nlp/cn/anaphora/AR_Reader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private void dothis() throws Exception{
6464
s2 = (Entity)it.next();
6565
eg = new EntityGroup(ss,s2);
6666
fp = new FeatureGeter(eg);
67-
String[] tokens = this.intArrayToString(fp.getFeatrue()).split("\\t+|\\s+");
67+
String[] tokens = this.intArrayToString(fp.getFeature()).split("\\t+|\\s+");
6868
newdata= Arrays.asList(tokens);
6969
in = new Instance(newdata,null);
7070
in.setSource(eg);

fnlp-core/src/main/java/org/fnlp/nlp/cn/anaphora/FeatureGeter.java

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@
3131
* @since FudanNLP 1.5
3232
*/
3333
public class FeatureGeter {
34-
private int[] featrue;
34+
private int[] feature;
3535
private EntityGroup eGroup;
3636
private Instance inst;
3737
public FeatureGeter(Instance inst){
3838
this.inst =inst;
3939
this.eGroup = (EntityGroup) inst.getData();
40-
featrue = new int[19];
40+
feature = new int[19];
4141
this.doFeature();
4242
}
4343
public FeatureGeter(EntityGroup eGroup){
44-
featrue = new int[19];
44+
feature = new int[19];
4545
this.eGroup = eGroup;
4646
this.doFeature();
4747
}
@@ -64,104 +64,104 @@ private void doFeature(){
6464
String behindData = behind.getData();
6565
Boolean bool = this.isSub(aheadData, behindData);
6666
if(bool){ //中心词匹配
67-
featrue[0] = 1;
67+
feature[0] = 1;
6868
}
6969
else
70-
featrue[0] = 0;
70+
feature[0] = 0;
7171

7272
if(ahead.getPosTag()==PartOfSpeech.人名) //I为人称代词
73-
featrue[1] = 1;
73+
feature[1] = 1;
7474
else
75-
featrue[1] = 0;
75+
feature[1] = 0;
7676
if(ahead.getPosTag()==PartOfSpeech.名词)
77-
featrue[2] = 1;
77+
feature[2] = 1;
7878
else
79-
featrue[2] = 0;
79+
feature[2] = 0;
8080
if(ahead.getPosTag().isEntiry())
81-
featrue[3] = 1;
81+
feature[3] = 1;
8282
else
83-
featrue[3] = 0;
83+
feature[3] = 0;
8484

8585
if(behind.getData().contains("他")||behind.getData().contains("她")) //J为人称代词
86-
featrue[4] = 1;
86+
feature[4] = 1;
8787
else
88-
featrue[4] = 0;
88+
feature[4] = 0;
8989
if(behind.getData().contains("它")) //J为人称代词
90-
featrue[5] = 1;
90+
feature[5] = 1;
9191
else
92-
featrue[5] = 0;
92+
feature[5] = 0;
9393
if(behind.getData().contains("我")||behind.getData().contains("你")) //J为人称代词
94-
featrue[6] = 1;
94+
feature[6] = 1;
9595
else
96-
featrue[6] = 0;
96+
feature[6] = 0;
9797
if(behind.getData().contains("自己")) //J为人称代词
98-
featrue[7] = 1;
98+
feature[7] = 1;
9999
else
100-
featrue[7] = 0;
100+
feature[7] = 0;
101101
if(behind.getPosTag().isPronoun())
102-
featrue[8] = 1;
102+
feature[8] = 1;
103103
else
104-
featrue[8] = 0;
104+
feature[8] = 0;
105105
if(behindData.contains("这")||behindData.contains("那")||
106106
behindData.contains("其")||behindData.contains("该")) //J为指示性名词
107-
featrue[9] = 1;
107+
feature[9] = 1;
108108
else
109-
featrue[9] = 0;
109+
feature[9] = 0;
110110
if(ahead.getPosTag().isPronoun())
111-
featrue[8] = 1;
111+
feature[8] = 1;
112112
else
113-
featrue[8] = 0;
113+
feature[8] = 0;
114114
if(ahead.getPosTag()==PartOfSpeech.名词)
115-
featrue[9] = 1;
115+
feature[9] = 1;
116116
else
117-
featrue[9] = 0;
117+
feature[9] = 0;
118118
if(ahead.getPosTag().isEntiry())
119-
featrue[10] = 1;
119+
feature[10] = 1;
120120
else
121-
featrue[10] = 0;
121+
feature[10] = 0;
122122
//是否性别一致
123123
if(ahead.getSex()!=behind.getSex()&&ahead.getSex()!=Sex.UNKONW){
124-
featrue[11] = 1;
124+
feature[11] = 1;
125125
}
126126
else
127-
featrue[11] = 0;
127+
feature[11] = 0;
128128
if(ahead.getSex()==Sex.UNKONW||behind.getSex()==Sex.UNKONW)
129-
featrue[12] = 1;
129+
feature[12] = 1;
130130
else
131-
featrue[12] = 0;
131+
feature[12] = 0;
132132
//是否单复数一致
133133
if(ahead.singular !=behind.singular&&ahead.singular!=Singular.UNKONW){
134-
featrue[13] = 1;
134+
feature[13] = 1;
135135
}
136136
else
137-
featrue[13] = 0;
137+
feature[13] = 0;
138138
if(ahead.singular==Singular.UNKONW||behind.singular==Singular.UNKONW)
139-
featrue[14] = 1;
139+
feature[14] = 1;
140140
else
141-
featrue[14] = 0;
141+
feature[14] = 0;
142142
if(ahead.getGraTag()==FUNC.SUB)
143-
featrue[15]= 1;
143+
feature[15]= 1;
144144
else
145-
featrue[15]= 0;
145+
feature[15]= 0;
146146
if(behind.getGraTag()==FUNC.SUB)
147-
featrue[16]= 1;
147+
feature[16]= 1;
148148
else
149-
featrue[16]= 0;
149+
feature[16]= 0;
150150
if(ahead.getGraTag()==FUNC.OBJ)
151-
featrue[17]= 1;
151+
feature[17]= 1;
152152
else
153-
featrue[17]= 0;
153+
feature[17]= 0;
154154
if(behind.getGraTag()==FUNC.OBJ)
155-
featrue[18]= 1;
155+
feature[18]= 1;
156156
else
157-
featrue[18]= 0;
157+
feature[18]= 0;
158158

159159
}
160160
public Instance getInst(){
161161
return this.inst;
162162
}
163-
public int[]getFeatrue(){
164-
return this.featrue;
163+
public int[]getFeature(){
164+
return this.feature;
165165
}
166166
public EntityGroup getEgroup(){
167167
return this.eGroup;

0 commit comments

Comments
 (0)