Examples of UnknownParameterException


Examples of net.sourceforge.align.ui.console.command.exception.UnknownParameterException

    } else if (cls.equals("translation")) {
      filter = new TranslationMacro();
    } else if (cls.equals("poisson-translation")) {
      filter = new PoissonTranslationMacro();
    } else {
      throw new UnknownParameterException("class");
    }

    filter = FilterDecorators.decorate(filter);

    Parser parser = new AlParser(getIn());
View Full Code Here

Examples of net.sourceforge.align.ui.console.command.exception.UnknownParameterException

          alignmentList.addAll(currentAlignmentList);
          reader.close();
        }
       
      } else {
        throw new UnknownParameterException("class");
      }
      Formatter formatter = new AlFormatter(getOut());
      formatter.format(alignmentList);
    } catch (IOException e) {
      throw new IORuntimeException(e);
View Full Code Here

Examples of net.sourceforge.align.ui.console.command.exception.UnknownParameterException

      formatter = new HtmlFormatter(writer);
    } else if (cls.equals("info")) {
      Writer writer = getSingleWriter(commandLine);
      formatter = new InfoFormatter(writer);
    } else {
      throw new UnknownParameterException("class");
    }
    Parser parser = new AlParser(getIn());
    List<Alignment> alignmentList = parser.parse();
    formatter.format(alignmentList);
  }
View Full Code Here

Examples of net.sourceforge.align.ui.console.command.exception.UnknownParameterException

      Pair<ModifyAlgorithm, ModifyAlgorithm> algorithmPair =
        createUnifyRareWordsAlgorithms(commandLine, alignmentList);
      sourceAlgorithm = algorithmPair.first;
      targetAlgorithm = algorithmPair.second;
    } else {
      throw new UnknownParameterException("class");
    }
    String part = commandLine.getOptionValue('p');
    if (part == null) {
      part = "both";
    }
    if (part.equals("both")) {
      if (targetAlgorithm == null) {
        targetAlgorithm = sourceAlgorithm;
      }
    } else if (part.equals("source")) {
      targetAlgorithm = new NullModifyAlgorithm();
    } else if (part.equals("target")) {
      sourceAlgorithm = new NullModifyAlgorithm();
    } else {
      throw new UnknownParameterException("part");
    }
   
    Formatter formatter = new AlFormatter(getOut());
   
    Filter filter = new Modifier(sourceAlgorithm, targetAlgorithm);
View Full Code Here

Examples of net.sourceforge.align.ui.console.command.exception.UnknownParameterException

      //  LanguageModelUtil.train(targetWidList);
      //TranslationModel translationModel =
      //  TranslationModelUtil.train(iterations, sourceWidList, targetWidList);
     
    } else {
      throw new UnknownParameterException("class");
    }
   
  }
View Full Code Here

Examples of net.sourceforge.align.ui.console.command.exception.UnknownParameterException

      if (cls.equals("intersection")) {
        filter = new IntersectionSelector(alignment);
      } else if (cls.equals("difference")) {
        filter = new DifferenceSelector(alignment);
      } else {
        throw new UnknownParameterException("class");
      }
    } else {
      throw new UnknownParameterException("class");
    }
   
    filter = FilterDecorators.decorate(filter);
   
    Parser parser = new AlParser(getIn());
View Full Code Here

Examples of net.sourceforge.align.ui.console.command.exception.UnknownParameterException

        } else if (search.equals("band")) {
          int radius = createInt(commandLine, "radius",
              BandMatrixFactory.DEFAULT_BAND_RADIUS);
          matrixFactory = new BandMatrixFactory(radius);
        } else {
          throw new UnknownParameterException("search");
        }
        if (cls.equals("viterbi")) {
          algorithm = new ViterbiAlgorithm(calculator,
              categoryMap, matrixFactory);
        } else if (cls.equals("fb")) {
          algorithm = new ForwardBackwardAlgorithm(calculator,
              categoryMap, matrixFactory);
        } else {
          throw new UnknownParameterException("class");
        }     
      } else if (search.equals("iterative-band")) {
        int radius = createInt(commandLine, "radius",
            BandMatrixFactory.DEFAULT_BAND_RADIUS);
        int margin = createInt(commandLine, "margin",
            AdaptiveBandAlgorithm.DEFAULT_MIN_BAND_MARGIN);
        float increment = createFloat(commandLine, "increment",
            AdaptiveBandAlgorithm.DEFAULT_BAND_INCREMENT_RATIO);
        HmmAlignAlgorithmFactory algorithmFactory;
        if (cls.equals("viterbi")) {
          algorithmFactory = new ViterbiAlgorithmFactory();
        } else if (cls.equals("fb")) {
          algorithmFactory = new ForwardBackwardAlgorithmFactory();
        } else {
          throw new UnknownParameterException("class");
        }
        algorithm = new AdaptiveBandAlgorithm(algorithmFactory,
            calculator, radius, increment, margin,
            categoryMap);
      } else {
        throw new UnknownParameterException("search");
      }
    } else if (cls.equals("one-to-one")) {
      boolean one = commandLine.hasOption('o');
      algorithm = new OneToOneAlgorithm(one);
    } else {
      throw new UnknownParameterException("class");
    }
    return algorithm;
  }
View Full Code Here

Examples of net.sourceforge.align.ui.console.command.exception.UnknownParameterException

    } else if (ctr.equals("word")) {
      counter = new SplitCounter();
    } else if (ctr.equals("char")) {
      counter = new CharCounter();
    } else {
      throw new UnknownParameterException("counter");
    }
    return counter;
  }
View Full Code Here

Examples of net.sourceforge.align.ui.console.command.exception.UnknownParameterException

        }
        Calculator remainingCalculator = createCalculator(
            commandLine, alignmentList, remainingCalculatorStringList);
        calculator = createOracleCalculator(commandLine, remainingCalculator);
      } else {
        throw new UnknownParameterException("calculator");
      }
      calculatorList.add(calculator);
    }
   
    Calculator calculator;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.