Cambridge SMT System
Feature.java
Go to the documentation of this file.
1 /*******************************************************************************
2  * Licensed under the Apache License, Version 2.0 (the "License");
3  * you may not use these files except in compliance with the License.
4  * You may obtain a copy of the License at
5  *
6  * http://www.apache.org/licenses/LICENSE-2.0
7  *
8  * Unless required by applicable law or agreed to in writing, software
9  * distributed under the License is distributed on an "AS IS" BASIS,
10  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11  * See the License for the specific language governing permissions and
12  * limitations under the License.
13  *
14  *******************************************************************************/
15 
16 package uk.ac.cam.eng.rule.features;
17 
18 public enum Feature {
19 
20  /*
21  * The order of the enum dictates the index of the feature in the HFile. To maintain backwards
22  * compatibility with old HFiles only add features to the end of this enum. Do not insert
23  * new features in between existing features.
24  */
25 
26  SOURCE2TARGET_PROBABILITY(Scope.GLOBAL, ComputeLocation.MAP_REDUCE),
27  TARGET2SOURCE_PROBABILITY(Scope.GLOBAL, ComputeLocation.MAP_REDUCE),
28  PROVENANCE_SOURCE2TARGET_PROBABILITY(Scope.PROVENANCE, ComputeLocation.MAP_REDUCE),
29  PROVENANCE_TARGET2SOURCE_PROBABILITY(Scope.PROVENANCE, ComputeLocation.MAP_REDUCE),
30  GLUE_RULE(Scope.GLOBAL, ComputeLocation.RETRIEVAL),
31  INSERT_SCALE(Scope.GLOBAL, ComputeLocation.RETRIEVAL),
32  SOURCE2TARGET_LEXICAL_PROBABILITY(Scope.GLOBAL, ComputeLocation.LEXICAL_SERVER),
33  TARGET2SOURCE_LEXICAL_PROBABILITY(Scope.GLOBAL, ComputeLocation.LEXICAL_SERVER),
34  PROVENANCE_SOURCE2TARGET_LEXICAL_PROBABILITY(Scope.PROVENANCE, ComputeLocation.LEXICAL_SERVER),
35  PROVENANCE_TARGET2SOURCE_LEXICAL_PROBABILITY(Scope.PROVENANCE, ComputeLocation.LEXICAL_SERVER),
36  RULE_COUNT_1(Scope.GLOBAL, ComputeLocation.RETRIEVAL),
37  RULE_COUNT_2(Scope.GLOBAL, ComputeLocation.RETRIEVAL),
38  RULE_COUNT_GREATER_THAN_2(Scope.GLOBAL, ComputeLocation.RETRIEVAL),
39  RULE_INSERTION_PENALTY(Scope.GLOBAL, ComputeLocation.RETRIEVAL),
40  WORD_INSERTION_PENALTY(Scope.GLOBAL, ComputeLocation.RETRIEVAL);
41 
47  public static enum Scope{
48  GLOBAL, PROVENANCE;
49  }
50 
58  public static enum ComputeLocation{
59  MAP_REDUCE, RETRIEVAL, LEXICAL_SERVER;
60  }
61 
62  public Scope scope;
63  public ComputeLocation computed;
64 
65  private Feature(Scope scope, ComputeLocation comp){
66  this.scope = scope;
67  this.computed = comp;
68  }
69 
70  public String getConfName() {
71  return name().toLowerCase();
72  }
73 
74  public static Feature findFromConf(String name) {
75  return valueOf(name.toUpperCase());
76  }
77 
78 }
static Feature findFromConf(String name)
Definition: Feature.java:74