Skip to content

Commit

Permalink
BasePhaseLoader: Allow parameters to be specified in 'options' blocks…
Browse files Browse the repository at this point in the history
… of 'inherit' type

This allows ECD blocks like:

  - inherit: jdbc.sqlite.cse.phase
    name: information-extractor
    options: |
      - inherit: phases.ie.fixedregex
        regex: "\\$[^.]*"

i.e. specifying parameters inline in the options block rather than only
in the inherited ECDs.
  • Loading branch information
pasky committed Jan 17, 2014
1 parent 87fd9af commit 43c30b6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/edu/cmu/lti/oaqa/ecd/phase/BasePhaseLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void loadOption(Map<String, Object> description, List<AnalysisEngineDescription>
} else {
String resource = (String) first.getValue();
List<AnalysisEngineDescription> options = doLoadOptions(ResourceHandle.newHandle(type,
resource));
resource), description);
aes.addAll(options);
}
} catch (Exception e) {
Expand Down Expand Up @@ -166,8 +166,12 @@ private List<AnalysisEngineDescription> createInnerPipeline(List<Map<String, Obj
}

private List<AnalysisEngineDescription> doLoadOptions(ResourceHandle handle) throws Exception {
List<AnalysisEngineDescription> aes = Lists.newArrayList();
Map<String, Object> tuples = Maps.newLinkedHashMap();
return doLoadOptions(handle, tuples);
}

private List<AnalysisEngineDescription> doLoadOptions(ResourceHandle handle, Map<String, Object> tuples) throws Exception {
List<AnalysisEngineDescription> aes = Lists.newArrayList();
Class<? extends AnalysisComponent> comp = BaseExperimentBuilder.loadFromClassOrInherit(handle,
AnalysisComponent.class, tuples);
AnyObject crossParams = (AnyObject) tuples.remove(CROSS_PARAMS_KEY);
Expand Down

0 comments on commit 43c30b6

Please sign in to comment.