16 package uk.ac.cam.eng.rule.features;
18 import org.apache.hadoop.io.ByteWritable;
25 static final double[] one =
new double[] { 1 };
27 static final double[] minusOne =
new double[] { -1 };
29 static final double[] empty =
new double[] { 0 };
31 private static final ByteWritable zeroIndex =
new ByteWritable((byte) 0);
34 static double[] ruleCount1(Rule r, FeatureFunctionInputData data) {
36 int count = data.counts.get(zeroIndex)
44 static double[] ruleCount2(Rule r, FeatureFunctionInputData data) {
46 int count = data.counts.get(zeroIndex)
54 static double[] ruleGreaterThan2(Rule r, FeatureFunctionInputData data) {
56 int count = data.counts.get(zeroIndex)
64 static double[] noOfWords(Rule r, FeatureFunctionInputData data) {
65 return new double[]{r.target().getWordCount()};