Package org.apache.lucene.util

Examples of org.apache.lucene.util.IntsRef.grow()


                System.arraycopy(nodes, 0, newNodes, 0, nodes.length);
                nodes = newNodes;
              }
              getNode(nodes, string.length).resetState(node.to);
              string.length++;
              string.grow(string.length);
            }
          } else {
            // No more transitions leaving this state,
            // pop/return back to previous state:
            assert pathStates.contains(node.state);
View Full Code Here


    final ByteSequenceOutputs outputs = ByteSequenceOutputs.getSingleton();
    final Builder<BytesRef> builder = new Builder<>(FST.INPUT_TYPE.BYTE1, outputs);

    final byte[] bytes = new byte[300];
    final IntsRef input = new IntsRef();
    input.grow(1);
    input.length = 1;
    final BytesRef output = new BytesRef(bytes);
    for(int arc=0;arc<6;arc++) {
      input.ints[0] = arc;
      output.bytes[0] = (byte) arc;
View Full Code Here

      String token = entry[0];
      if (!token.equals(lastValue)) {
        // new word to add to fst
        ord++;
        lastValue = token;
        scratch.grow(token.length());
        scratch.length = token.length();
        for (int i = 0; i < token.length(); i++) {
          scratch.ints[i] = (int) token.charAt(i);
        }
        fstBuilder.add(scratch, ord);
View Full Code Here

        // swap current
        if (cmp > 0 || currentEntry == null) {
          currentEntry = entry;
          currentOrds = new IntsRef(); // must be this way
        }
        currentOrds.grow(currentOrds.length+1);
        currentOrds.ints[currentOrds.length++] = ord;
      }
    }
   
    // finalize last entry
View Full Code Here

    final ByteSequenceOutputs outputs = ByteSequenceOutputs.getSingleton();
    final Builder<BytesRef> builder = new Builder<BytesRef>(FST.INPUT_TYPE.BYTE1, outputs);

    final byte[] bytes = new byte[300];
    final IntsRef input = new IntsRef();
    input.grow(1);
    input.length = 1;
    final BytesRef output = new BytesRef(bytes);
    for(int arc=0;arc<6;arc++) {
      input.ints[0] = arc;
      output.bytes[0] = (byte) arc;
View Full Code Here

    final ByteSequenceOutputs outputs = ByteSequenceOutputs.getSingleton();
    final Builder<BytesRef> builder = new Builder<BytesRef>(FST.INPUT_TYPE.BYTE1, outputs);

    final byte[] bytes = new byte[300];
    final IntsRef input = new IntsRef();
    input.grow(1);
    input.length = 1;
    final BytesRef output = new BytesRef(bytes);
    for(int arc=0;arc<6;arc++) {
      input.ints[0] = arc;
      output.bytes[0] = (byte) arc;
View Full Code Here

      String token = entry[0];
      if (!token.equals(lastValue)) {
        // new word to add to fst
        ord++;
        lastValue = token;
        scratch.grow(token.length());
        scratch.length = token.length();
        for (int i = 0; i < token.length(); i++) {
          scratch.ints[i] = (int) token.charAt(i);
        }
        fstBuilder.add(scratch, ord);
View Full Code Here

        data.add(readings[i] + INTERNAL_SEPARATOR + pos);
        wordId++;
      }
      // add mapping to FST
      String token = values[0];
      scratch.grow(token.length());
      scratch.length = token.length();
      for (int i = 0; i < token.length(); i++) {
        scratch.ints[i] = (int) token.charAt(i);
      }
      fstBuilder.add(scratch, ord);
View Full Code Here

    final ByteSequenceOutputs outputs = ByteSequenceOutputs.getSingleton();
    final Builder<BytesRef> builder = new Builder<BytesRef>(FST.INPUT_TYPE.BYTE1, outputs);

    final byte[] bytes = new byte[300];
    final IntsRef input = new IntsRef();
    input.grow(1);
    input.length = 1;
    final BytesRef output = new BytesRef(bytes);
    for(int arc=0;arc<6;arc++) {
      input.ints[0] = arc;
      output.bytes[0] = (byte) arc;
View Full Code Here

      String token = entry[0];
      if (!token.equals(lastValue)) {
        // new word to add to fst
        ord++;
        lastValue = token;
        scratch.grow(token.length());
        scratch.length = token.length();
        for (int i = 0; i < token.length(); i++) {
          scratch.ints[i] = (int) token.charAt(i);
        }
        fstBuilder.add(scratch, ord);
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.