Package com.google.common.base

Examples of com.google.common.base.Splitter.split()


            options.put(values.get(0), values.get(1));
        }

        if (options.containsKey("model")) {
            if (options.containsKey("categories")) {
                categories = Lists.newArrayList(onSpaces.split(options.get("categories")));
                Configuration conf = UDFContext.getUDFContext().getJobConf();
                model = PolymorphicWritable.read(FileSystem.get(conf).open(new Path(options.get("model"))), OnlineLogisticRegression.class);
                options.remove("model");
                options.remove(("categories"));
            } else {
View Full Code Here


            } else {
                throw new BadClassifierSpecException("Must specify \"categories\" if pre-existing model is used");
            }
        } else {
            if (options.containsKey("categories") && options.containsKey("features")) {
                categories = Lists.newArrayList(onSpaces.split(options.get("categories")));
                if (categories.size() < 2) {
                    throw new BadClassifierSpecException("Must have more than one target category.  Remember that categories is a space separated list");
                }
                model = new OnlineLogisticRegression(categories.size(), Integer.parseInt(options.get("features")), new L1());
                options.remove("categories");
View Full Code Here

        Joiner withSpaces = Joiner.on(" ");

        Map<String, String> options = Maps.newHashMap();

        for (String option : onComma.split(modelParams)) {
            List<String> values = Lists.newArrayList(onEquals.split(option));
            options.put(values.get(0), values.get(1));
        }

        if (options.containsKey("sequence")) {
            location = options.get("sequence");
View Full Code Here

    public PathDocumentFilter setPattern(String pattern) {
        Splitter splitter =
                Splitter.on(DOCUMENT_FILTER_LIST_DELIMITER).trimResults()
                        .omitEmptyStrings();
        patterns = Sets.newHashSet(splitter.split(pattern));
        patternsInLowerCase =
                Sets.newHashSet(splitter.split(pattern.toLowerCase()));
        return this;
    }
View Full Code Here

        Splitter splitter =
                Splitter.on(DOCUMENT_FILTER_LIST_DELIMITER).trimResults()
                        .omitEmptyStrings();
        patterns = Sets.newHashSet(splitter.split(pattern));
        patternsInLowerCase =
                Sets.newHashSet(splitter.split(pattern.toLowerCase()));
        return this;
    }

    public PathDocumentFilter setFullText(boolean fullText) {
        isFullText = fullText;
View Full Code Here

  Matrix readTsv(String name) throws IOException {
    Splitter onTab = Splitter.on("\t");
    List<String> lines = Resources.readLines((Resources.getResource(name)), Charsets.UTF_8);
    int rows = lines.size();
    int columns = Iterables.size(onTab.split(lines.get(0)));
    Matrix r = new DenseMatrix(rows, columns);
    int row = 0;
    for (String line : lines) {
      Iterable<String> values = onTab.split(line);
      int column = 0;
View Full Code Here

    int rows = lines.size();
    int columns = Iterables.size(onTab.split(lines.get(0)));
    Matrix r = new DenseMatrix(rows, columns);
    int row = 0;
    for (String line : lines) {
      Iterable<String> values = onTab.split(line);
      int column = 0;
      for (String value : values) {
        r.set(row, column, Double.parseDouble(value));
        column++;
      }
View Full Code Here

    @Inject(value = "struts.freeroute.controllerSuffixes", required = true)
    private void setControllerSuffixes(String controllerSuffixes) {

        Splitter splitter = Splitter.on(",").trimResults().omitEmptyStrings();
        this.controllerSuffixes = Sets.newHashSet(splitter.split(controllerSuffixes));
    }

    @Inject(value = "struts.freeroute.defaultParentPackage", required = true)
    private void setDefaultParentPackage(String defaultParentPackage) {
        this.defaultParentPackage = defaultParentPackage;
View Full Code Here

            Project p = main != null ? main : project;
            List<File> files = new ArrayList<File>();
            String paths = p.getProguardPath();
            if (paths != null) {
                Splitter splitter = Splitter.on(CharMatcher.anyOf(":;")); //$NON-NLS-1$
                for (String path : splitter.split(paths)) {
                    if (path.contains("${")) { //$NON-NLS-1$
                        // Don't analyze the global/user proguard files
                        continue;
                    }
                    File file = new File(path);
View Full Code Here

            return sb.toString();
        }

        public Iterator<String> getIterator() {
            Splitter page = Splitter.fixedLength(PAGE_SIZE);
            return page.split(sb.toString()).iterator();
        }

    }

    private PrintStream stream;
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.