Example #1
0
 protected DependencyPathAcceptor getAcceptor() {
   // Create the acceptor.
   DependencyPathAcceptor acceptor;
   if (argOptions.hasOption('p'))
     acceptor = ReflectionUtil.getObjectInstance(argOptions.getStringOption('p'));
   else acceptor = new UniversalPathAcceptor();
   return acceptor;
 }
Example #2
0
 protected DependencyPathWeight getWeighter() {
   // Create the weighter.
   DependencyPathWeight weight;
   if (argOptions.hasOption('G'))
     weight = ReflectionUtil.getObjectInstance(argOptions.getStringOption('G'));
   else weight = new FlatPathWeight();
   return weight;
 }
Example #3
0
 /** {@inheritDoc} */
 protected SemanticSpace getSpace() {
   Transform transform = null;
   if (argOptions.hasOption('T'))
     transform = ReflectionUtil.getObjectInstance(argOptions.getStringOption('T'));
   else transform = new NoTransform();
   int bound = argOptions.getIntOption('b', 10000);
   int windowSize = argOptions.getIntOption('w', 5);
   return new OccurrenceCounter(transform, bound, windowSize);
 }
Example #4
0
 protected void handleExtraOptions() {
   // Load the basis map from disk if one is specified.  Otherwise try to
   // load one from the command line.  If neither option is provided,
   // default to a WordBasedBasisMapping.
   if (argOptions.hasOption('L')) {
     basis = loadObject(openLoadFile());
     basis.setReadOnly(true);
   } else if (argOptions.hasOption('B'))
     basis = ReflectionUtil.getObjectInstance(argOptions.getStringOption('B'));
   else basis = new WordBasedBasisMapping();
 }