Package it.unimi.dsi.lang

Examples of it.unimi.dsi.lang.MutableString


        Type collectionType = new TypeToken<Collection<Query>>() {
        }.getType();
        WordReader wordReader = wordReaderType.getWordReader();

        final Collection<Query> queries = gson.fromJson(new InputStreamReader(System.in), collectionType);
        MutableString word = new MutableString();
        MutableString delimiter = new MutableString();

        for (Query query : queries) {
            if (query.query == null) throw new RuntimeException("A query has no 'query' field");
            if (query.id == null) throw new RuntimeException("A query has no 'id' field");
            wordReader.setReader(new StringReader(query.query));
View Full Code Here


        for(int i = fields.length; --i >= 0; ) {
            fields[i] = factory.fieldIndex(fieldNames.get(i));
            types[i] = factory.fieldType(i);
        }

        MutableString s = new MutableString();
        final DocumentIterator iterator = collection.iterator();
        for(Document document = iterator.nextDocument(); document != null; document = iterator.nextDocument()) {
            System.out.format("Document %s", document.uri());

            for(int i = 0; i < fields.length; i++) {
View Full Code Here

            types[i] = factory.fieldType(i);
        }


        final long numberOfDocuments = collection.size();
        MutableString word = new MutableString();
        MutableString delimiter = new MutableString();

        while (true) {
            // Select a starting document
            final int start = (int) (Math.random() * (numberOfDocuments - batchSize));
            try(final DocumentIterator iterator =
View Full Code Here

       int start = (wbRequest.getPageNum()-1) * hitsPerPage;
       if (urlStr == null || urlStr.length() <= 0) {
           throw new BadQueryException("Url is empty.");
       }
       // Construct the search url.
       MutableString ms = new MutableString(this.searchUrlBase)
           .append("?query=");
       // Add 'date:...+' to query string.
       ms.append("date%3A").append(startDateStr).append('-').append(endDateStr);
       ms.append('+');
       // Add 'url:URL'.
       if(wbRequest.isUrlQueryRequest()) {
           ms.append("url%3A");
       } else {
           ms.append("exacturl%3A");
       }
       try {
            ms.append(java.net.URLEncoder.encode("\""+urlStr+"\"", "UTF-8"));
       } catch (UnsupportedEncodingException e) {
         throw new BadQueryException(e.toString());
       }
       ms.append("&hitsPerPage=").append(hitsPerPage);
       ms.append("&start=").append(start);
       ms.append("&dedupField=site");
       // As we are always searching agains an url, a
       // higher perDup/Site will return just more versions
       ms.append("&hitsPerDup=").append(hitsPerPage);
       ms.append("&hitsPerSite=").append(hitsPerPage);
      
       return ms.toString();
   }
View Full Code Here

TOP

Related Classes of it.unimi.dsi.lang.MutableString

Copyright © 2018 www.massapicom. 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.