Get the morphological features configuration.

@param params
the training parameters
@return a list containing the options
546555
public static String getPOSTagModelFeaturesRange(
      final TrainingParameters params) {
    String lemmaRangeFlag = null;
    if (params.getSettings().get("POSTagModelFeaturesRange") != null) {
      lemmaRangeFlag = params.getSettings().get("POSTagModelFeaturesRange");
    } else {
      lemmaRangeFlag = Flags.DEFAULT_POSTAG_RANGE;
    }
    return lemmaRangeFlag;
  }
1178059
public List getVariations(String imgName) {

        List ret = (List)m_variations.get(imgName);
        if (ret == null) {
            return new ArrayList();
        }
        Collections.sort(ret);
        return ret;
    }
458998
function _parseParams(params) {
  return params.map((param) => {
    let result;
    switch (param.type) {
      case 'Identifier':
        result = new Param(param.name);
        break;
      case 'AssignmentPattern':
        result = new Param(param.left.name, true);
        break;
      case 'ObjectPattern': {
        const objParams = param.properties.map((objParam) => objParam.value);
        result = new Param('arguments', false, _parseParams(objParams));
        break;
      }
      default:
    }
    return result;
  });
}
105093
public static final ParseResult parseParams(Object[] params) {
		Tree data = null;
		CallOptions.Options opts = null;
		Groups groups = null;
		PacketStream stream = null;
		if (params != null) {
			if (params.length == 1) {
				if (params[0] instanceof Tree) {
					data = (Tree) params[0];
				} else if (params[0] instanceof CallOptions.Options) {
					opts = (CallOptions.Options) params[0];
				} else if (params[0] instanceof Groups) {
					groups = (Groups) params[0];
				} else if (params[0] instanceof PacketStream) {
					data = new Tree();
					stream = (PacketStream) params[0];
				} else {
					data = new CheckedTree(params[0]);
				}
			} else {
				LinkedHashMap<String, Object> map = new LinkedHashMap<>();
				String prev = null;
				Object value;
				for (int i = 0; i < params.length; i++) {
					value = params[i];
					if (prev == null) {
						if (!(value instanceof String)) {
							if (value instanceof CallOptions.Options) {
								opts = (CallOptions.Options) value;
								continue;
							}
							if (value instanceof Groups) {
								groups = (Groups) value;
								continue;
							}
							if (value instanceof PacketStream) {
								stream = (PacketStream) value;
								continue;
							}
							i++;
							throw new IllegalArgumentException("Parameter #" + i + " (\"" + value
									+ "\") must be String, Context, Groups, PacketStream or CallOptions!");
						}
						prev = (String) value;
						continue;
					}
					map.put(prev, value);
					prev = null;
				}
				data = new Tree(map);
			}
		}
		return new ParseResult(data, opts, groups, stream);
	}
127079
private static Map<String,String> getRankMap(Object[] params){
        if (params == null) {
            return null;
        }
        HashMap<String,String> result = new HashMap<>();
        for (int i = 0; i < params.length; i++) {
            String name = params[i] instanceof Parameter ?
                ((Parameter) params[i]).name() :
                ((TypeVariable) params[i]).typeName();
            result.put(name, String.valueOf(i));
        }
        return result;
    }
1342538
public Set<String> getStringSet(final String param) {
    return get(param, new StringToStringSet(","),
        new AlwaysValid<Set<String>>(),
        "comma-separated list of strings");
  }
749514
public String getInitParameter(String param)
    {
        if (_initParams==null)
            return null;
        return (String)_initParams.get(param);
    }
245859
public Node createOptionalParameters(JSType... parameterTypes) {
    FunctionParamBuilder builder = new FunctionParamBuilder(this);
    builder.addOptionalParams(parameterTypes);
    return builder.build();
  }
559956
@SuppressWarnings("rawtypes")
	public Class[] getParamtersTypes() {
		final Class[] types = new Class[this.paramters.length];
		for (int i = 0; i < types.length; i++) {
			types[i] = this.paramters[i].getClass();
		}
		return types;
	}
477836
private ParamTag[] paramTags(boolean typeParams) {
        ListBuffer<ParamTag> found = new ListBuffer<ParamTag>();
        for (Tag next : tagList) {
            if (next instanceof ParamTag) {
                ParamTag p = (ParamTag)next;
                if (typeParams == p.isTypeParameter()) {
                    found.append(p);
                }
            }
        }
        return found.toArray(new ParamTag[found.length()]);
    }
155806
private final POSTaggerFactory getTrainerFactory(
      final TrainingParameters params) {
    POSTaggerFactory posTaggerFactory = null;
    final String featureSet = Flags.getFeatureSet(params);
    Dictionary ngramDictionary = null;
    if (Flags.getNgramDictFeatures(params) != Flags.DEFAULT_DICT_CUTOFF) {
      ngramDictionary = createNgramDictionary(getDictSamples(),
          getNgramDictCutOff());
    }
    if (featureSet.equalsIgnoreCase("Opennlp")) {
      try {
        posTaggerFactory = POSTaggerFactory.create(
            POSTaggerFactory.class.getName(), ngramDictionary, null);
      } catch (final InvalidFormatException e) {
        e.printStackTrace();
      }
    } else {
      try {
        posTaggerFactory = POSTaggerFactory.create(
            BaselineFactory.class.getName(), ngramDictionary, null);
      } catch (final InvalidFormatException e) {
        e.printStackTrace();
      }
    }
    return posTaggerFactory;
  }
584969
private static String[] convertParameters(Class<?>[] params)
   {
      List<String> tmp = new ArrayList<String>();
      for (Class<?> c : params)
      {
         if (c.isArray())
         {
            StringBuffer sb = new StringBuffer();
            Class<?> subType = c.getComponentType();
            sb.append(subType.getName());
            // Convert to type[][]...[]
            while (subType != null)
            {
               sb.append("[]");
               subType = subType.getComponentType();
            }
            tmp.add(sb.toString());
         }
         else
         {
            tmp.add(c.getName());
         }
      }
      String[] sig = new String[tmp.size()];
      tmp.toArray(sig);
      return sig;
   }
1267132
public final POSModel train(final TrainingParameters params) {
    // features
    if (getPosTaggerFactory() == null) {
      throw new IllegalStateException(
          "Classes derived from AbstractTrainer must "
              + " create a POSTaggerFactory features!");
    }
    // training model
    POSModel trainedModel = null;
    POSEvaluator posEvaluator = null;
    try {
      trainedModel = POSTaggerME.train(this.lang, this.trainSamples, params,
          getPosTaggerFactory());
      final POSTaggerME posTagger = new POSTaggerME(trainedModel);
      posEvaluator = new POSEvaluator(posTagger);
      posEvaluator.evaluate(this.testSamples);
    } catch (final IOException e) {
      System.err.println("IO error while loading training and test sets!");
      e.printStackTrace();
      System.exit(1);
    }
    System.out.println("Final result: " + posEvaluator.getWordAccuracy());
    return trainedModel;
  }
31357
private Chart getChartFromParams(final PageParameters params) {
        String chartString;
        String themeString;
        Chart config;

        //If the showcase is started without any parameters
        //set the parameters to lineBasic and give us a line Chart
        if(params.getAllNamed().size() < 2){
            PageParameters temp = new PageParameters();
            temp.add("theme", "default");
            temp.add("chart", "line");
            setResponsePage(HomepageHighcharts.class, temp);
            config = new Chart("chart", new BasicLineOptions(), null);
            return config;
        }

        themeString = params.getAllNamed().get(0).getValue();
        Theme theme = getThemeFromParams(themeString);
        chartString = params.getAllNamed().get(1).getValue();

        if(chartString == null) {
            config = new Chart("chart", new BasicLineOptions(), theme);
            return config;
        }

        switch(chartString) {
            case "basicBar":
                config = new Chart("chart", new BasicBarOptions(), theme);
                break;

            case "splineWithSymbols":
                config = new Chart("chart", new SplineWithSymbolsOptions(), theme);
                break;

            case "irregularIntervals":
                config = new Chart("chart", new TimeDataWithIrregularIntervalsOptions(), theme);
                break;

            case "logarithmicAxis":
                config = new Chart("chart", new LogarithmicAxisOptions(), theme);
                break;

            case "scatter":
                config = new Chart("chart", new ScatterPlotOptions(), theme);
                break;

            case "area":
                config = new Chart("chart", new BasicAreaOptions(), theme);
                break;

            case "areaWithNegativeValues":
                config = new Chart("chart", new AreaWithNegativeValuesOptions(), theme);
                break;

            case "stackedAndGroupedColumn":
                config = new Chart("chart", new StackedAndGroupedColumnOptions(), theme);
                break;

            case "combo":
                config = new Chart("chart", new ComboOptions(), theme);
                break;

            case "donut":
                config = new Chart("chart", new DonutOptions(), theme);
                break;

            case "withDataLabels":
                config = new Chart("chart", new LineWithDataLabelsOptions(), theme);
                break;

            case "zoomableTimeSeries":
                config = new Chart("chart", new ZoomableTimeSeriesOptions(), theme);
                break;

            case "splineInverted":
                config = new Chart("chart", new SplineWithInvertedAxisOptions(), theme);
                break;

            case "splineWithPlotBands":
                config = new Chart("chart", new SplineWithPlotBandsOptions(), theme);
                break;

            case "polar":
                config = new Chart("chart", new PolarOptions(), theme);
                break;

            case "stackedArea":
                config = new Chart("chart", new StackedAreaOptions(), theme);
                break;

            case "percentageArea":
                config = new Chart("chart", new PercentageAreaOptions(), theme);
                break;

            case "areaMissing":
                config = new Chart("chart", new AreaMissingOptions(), theme);
                break;

            case "areaInverted":
                config = new Chart("chart", new AreaInvertedAxisOptions(), theme);
                break;

            case "areaSpline":
                config = new Chart("chart", new AreaSplineOptions(), theme);
                break;

            case "areaSplineRange":
                config = new Chart("chart", new AreaSplineRangeOptions(), theme);
                break;

            case "columnWithDrilldown":
                config = new Chart("chart", new ColumnWithDrilldownOptions(), theme);
                break;

            case "columnRotated":
                config = new Chart("chart", new ColumnWithRotatedLabelsOptions(), theme);
                break;

            case "stackedBar":
                config = new Chart("chart", new StackedBarOptions(), theme);
                break;

            case "barNegativeStack":
                config = new Chart("chart", new StackedBarOptions(), theme);
                break;

            case "basicColumn":
                config = new Chart("chart", new BasicColumnOptions(), theme);
                break;

            case "columnWithNegativeValues":
                config = new Chart("chart", new ColumnWithNegativeValuesOptions(), theme);
                break;

            case "stackedColumn":
                config = new Chart("chart", new StackedColumnOptions(), theme);
                break;

            case "stackedPercentage":
                config = new Chart("chart", new StackedPercentageOptions(), theme);
                break;

            case "basicPie":
                config = new Chart("chart", new BasicPieOptions(), theme);
                break;

            case "pieWithGradient":
                config = new Chart("chart", new PieWithGradientOptions(), theme);
                break;

            case "pieWithLegend":
                config = new Chart("chart", new PieWithLegendOptions(), theme);
                break;

            case "splineUpdating":
                config = new Chart("chart", new WicketSplineUpdatingOptions(), theme);
                break;

            case "bubble":
                config = new Chart("chart", new BubbleChartOptions(), theme);
                break;

            case "3dbubble":
                config = new Chart("chart", new BubbleChart3DOptions(), theme);
                break;

            case "boxplot":
                config = new Chart("chart", new BoxplotChartOptions(), theme);
                break;

            case "interactive":
                config = new Chart("chart", new InteractionOptions(), theme);
                break;

            case "angularGauge":
                config = new Chart("chart", new AngularGaugeOptions(), theme);
                break;

            case "spiderweb":
                config = new Chart("chart", new SpiderwebOptions(), theme);
                break;

            case "windrose":
                config = new Chart("chart", new WindroseOptions(), theme);
                break;

            case "columnrange":
                config = new Chart("chart", new ColumnRangeOptions(), theme);
                break;

            case "arearange":
                config = new Chart("chart", new AreaRangeOptions(), theme);
                break;

            case "clicktoadd":
                config = new Chart("chart", new ClickToAddAPointOptions(), theme);
                break;

            case "dualAxes":
                config = new Chart("chart", new DualAxesOptions(), theme);
                break;

            case "scatterWithRegression":
                config = new Chart("chart", new ScatterWithRegressionLineOptions(), theme);
                break;

            case "multipleAxes":
                config = new Chart("chart", new MultipleAxesOptions(), theme);
                break;

            case "errorBar":
                config = new Chart("chart", new ErrorBarOptions(), theme);
                break;

            case "funnel":
                config = new Chart("chart", new FunnelOptions(), theme);
                break;

            case "pyramid":
                config = new Chart("chart", new PyramidOptions(), theme);
                break;

            case "heatmap":
                config = new Chart("chart", new HeatmapOptions(), theme);
                break;

            default:
                config = new Chart("chart", new BasicLineOptions(), theme);
                break;
        }
        return config;
    }
952544
public String[][] getRequiredRuleNames(Param param) {
		if (isFiltered(param)) {
			return EMPTY_ARRAY;
		}
		AbstractElement elementToParse = param.elementToParse;
		String ruleName = param.ruleName;
		if (ruleName == null) {
			return getRequiredRuleNames(param, elementToParse);
		}
		return getAdjustedRequiredRuleNames(param, elementToParse, ruleName);
	}
32991
private List<Chart> getChartFromParams(final PageParameters params) {
        String chartString;
        List<Chart> config = new ArrayList<>();

        //If the showcase is started without any parameters
        //set the parameters to lineBasic and give us a line Chart
        final String chartComponentID = "chart";
        if(params.getAllNamed().isEmpty()){
            PageParameters temp = new PageParameters();
            temp.add("chart", "lineBasic");
            setResponsePage(HomepageChartJs.class, temp);
            config.add(new Chart(chartComponentID, new LineChartBasicConfiguration()));
            return config;
        }

        chartString = params.getAllNamed().get(0).getValue();
        if(chartString == null) {
    		config.add(new Chart(chartComponentID, new LineChartBasicConfiguration()));
    		return config;
    	}

        switch(chartString) {

            case "barVertical":
                config.add(new Chart(chartComponentID, new BarChartVerticalConfiguration()));
                break;

            case "barHorizontal":
                config.add(new Chart(chartComponentID, new BarChartHorizontalConfiguration()));
                break;

            case "barMultiAxis":
                config.add(new Chart(chartComponentID, new BarChartMultiAxisConfiguration()));
                break;

            case "barStacked":
                config.add(new Chart(chartComponentID, new BarChartStackedConfiguration()));
                break;

            case "barStackedGroup":
                config.add(new Chart(chartComponentID, new BarChartStackedGroupConfiguration()));
                break;

            case "lineBasic":
                config.add(new Chart(chartComponentID, new LineChartBasicConfiguration()));
                break;

            case "lineMultiAxis":
                config.add(new Chart(chartComponentID, new LineChartMultiAxisConfiguration()));
                break;

            case "lineStepped":
                config.add(new Chart(chartComponentID, new LineChartSteppedBeforeConfiguration()));
                config.add(new Chart(chartComponentID, new LineChartSteppedAfterConfiguration()));
                break;

            case "lineInterpolated":
                config.add(new Chart(chartComponentID, new LineChartInterpolatedConfiguration()));
                break;

            case "lineStyles":
                config.add(new Chart(chartComponentID, new LineStylesConfiguration()));
                break;

            case "pointStyles":
                config.add(new Chart(chartComponentID, new PointStylesConfiguration()));
                break;

            case "pointSizes":
                config.add(new Chart(chartComponentID, new LineChartWithDifferentPointSizesConfiguration()));
                break;

            case "areaLineBoundaries":
                config.add(new Chart(chartComponentID, new AreaLineBoundariesChartStartConfiguration()));
                config.add(new Chart(chartComponentID, new AreaLineBoundariesChartEndConfiguration()));
                config.add(new Chart(chartComponentID, new AreaLineBoundariesChartOriginConfiguration()));
                config.add(new Chart(chartComponentID, new AreaLineBoundariesChartFalseConfiguration()));
                break;

            case "lineDataset":
                config.add(new Chart(chartComponentID, new LineChartAreaDatasetConfiguration()));
                break;

            case "lineStacked":
                config.add(new Chart(chartComponentID, new LineChartStackedConfiguration()));
                break;

            case "radar":
                config.add(new Chart(chartComponentID, new RadarChartConfiguration()));
                break;

            case "scatter":
                config.add(new Chart(chartComponentID, new ScatterChartConfiguration()));
                break;

            case "scatterMultiAxis":
                config.add(new Chart(chartComponentID, new ScatterChartMultiAxisConfiguration()));
                break;

            case "doughnut":
                config.add(new Chart(chartComponentID, new DoughnutChartConfiguration()));
                break;

            case "pie":
                config.add(new Chart(chartComponentID, new PieChartConfiguration()));
                break;

            case "polarArea":
                config.add(new Chart(chartComponentID, new PolarAreaChartConfiguration()));
                break;

            case "radar2":
                config.add(new Chart(chartComponentID, new OtherRadarChartConfiguration()));
                break;

            case "comboBarLine":
                config.add(new Chart(chartComponentID, new ComboBarLineChartConfiguration()));
                break;

            case "stepSize":
                config.add(new Chart(chartComponentID, new LinearStepSizeConfiguration()));
                break;

            case "minMax":
                config.add(new Chart(chartComponentID, new MinMaxConfiguration()));
                config.add(new Chart(chartComponentID, new MinMaxSuggestedConfiguration()));
                break;

            case "lineLogarithmic":
                config.add(new Chart(chartComponentID, new LogarithmicLineChartConfiguration()));
                break;

            case "scatterLogarithmic":
                config.add(new Chart(chartComponentID, new LogarithmicScatterChartConfiguration()));
                break;

            case "timeLine":
                config.add(new Chart(chartComponentID, new TimeLineConfiguration()));
                break;

            case "timePoint":
                config.add(new Chart(chartComponentID, new TimePointConfiguration()));
                break;

            case "timeSeries":
                config.add(new Chart(chartComponentID, new TimeSeriesConfiguration()));
                break;

            case "timeCombo":
                config.add(new Chart(chartComponentID, new TimeComboConfigurationWicket8()));
                break;

            case "gridLines":
                config.add(new Chart(chartComponentID, new GridLinesBasicConfiguration()));
                config.add(new Chart(chartComponentID, new GridLinesDisplayFalseConfiguration()));
                config.add(new Chart(chartComponentID, new GridLinesDisplayFalseNoBorderConfiguration()));
                config.add(new Chart(chartComponentID, new GridLinesChartAreaConfiguration()));
                config.add(new Chart(chartComponentID, new GridLinesTicksConfiguration()));
                config.add(new Chart(chartComponentID, new GridLineStylesConfiguration()));
                break;

            case "multiLineLabels":
                config.add(new Chart(chartComponentID, new MultilineLabelsConfiguration()));
                break;

            case "filteringLabels":
                config.add(new Chart(chartComponentID, new FilteringLabelsConfiguration()));
                break;

            case "nonNumeric":
                config.add(new Chart(chartComponentID, new NonNumericConfiguration()));
                break;

            case "legendPosition":
                config.add(new Chart(chartComponentID, new LegendPositionTopConfiguration()));
                config.add(new Chart(chartComponentID, new LegendPositionRightConfiguration()));
                config.add(new Chart(chartComponentID, new LegendPositionBottomConfiguration()));
                config.add(new Chart(chartComponentID, new LegendPositionLeftConfiguration()));
                break;

            case "legendPointStyle":
                config.add(new Chart(chartComponentID, new LegendPointStyleConfiguration()));
                break;

            case "tooltip":
                config.add(new Chart(chartComponentID, new TooltipBorderConfiguration()));
                config.add(new Chart(chartComponentID, new TooltipCallbacksConfiguration()));
                config.add(new Chart(chartComponentID, new TooltipAverageConfiguration()));
                config.add(new Chart(chartComponentID, new TooltipNearestConfiguration()));
                break;

            case "tooltipHtml":
                config.add(new Chart(chartComponentID, new TooltipHtmlLineConfiguration()));
                config.add(new Chart(chartComponentID, new TooltipHtmlPieConfigurationWicket8()));
                config.add(new Chart(chartComponentID, new TooltipHtmlPointsConfigurationWicket8()));
                break;

            case "bubble":
                config.add(new Chart(chartComponentID, new BubbleChartConfiguration()));
                break;

            case "lineProgressBar":
                config.add(new Chart(chartComponentID, new LineChartProgressBarConfigurationWicket8()));
                break;

            case "dataLabelling":
                config.add(new Chart(chartComponentID, new DataLabellingChartConfiguration()));
                break;

            case "tooltipInteractions":
                config.add(new Chart(chartComponentID, new DatasetIntersectFalseConfiguration()));
                config.add(new Chart(chartComponentID, new DatasetIntersectTrueConfiguration()));
                config.add(new Chart(chartComponentID, new IndexIntersectFalseConfiguration()));
                config.add(new Chart(chartComponentID, new IndexIntersectTrueConfiguration()));
                config.add(new Chart(chartComponentID, new NearestIntersectFalseConfiguration()));
                config.add(new Chart(chartComponentID, new NearestIntersectTrueConfiguration()));
                config.add(new Chart(chartComponentID, new PointIntersectFalseConfiguration()));
                config.add(new Chart(chartComponentID, new PointIntersectTrueConfiguration()));
                config.add(new Chart(chartComponentID, new xIntersectFalseConfiguration()));
                config.add(new Chart(chartComponentID, new xIntersectTrueConfiguration()));
                config.add(new Chart(chartComponentID, new yIntersectFalseConfiguration()));
                config.add(new Chart(chartComponentID, new yIntersectTrueConfiguration()));
                break;

            default:
                config.add(new Chart(chartComponentID, new LineChartBasicConfiguration()));
                break;
        }
        return config;
    }
367393
private List<Node> createStringsFromParamList(Node params) {
    Node param = params.getFirstChild();
    ArrayList<Node> names = new ArrayList<>();
    while (param != null) {
      if (param.isName()) {
        names.add(IR.string(param.getString()).srcref(param));
      } else if (param.isDestructuringPattern()) {
        compiler.report(JSError.make(param,
            INJECTED_FUNCTION_HAS_DESTRUCTURED_PARAM));
        return new ArrayList<>();
      } else if (param.isDefaultValue()) {
        compiler.report(JSError.make(param,
            INJECTED_FUNCTION_HAS_DEFAULT_VALUE));
        return new ArrayList<>();
      }
      param = param.getNext();
    }
    return names;
  }