Reads the results from the retrieval phase from the DOCUMENT and the DOCUEMNT_GS views of the
JCAs, and generates and evaluates them using the evaluate method from the FMeasureConsumer
class.
339272
@Override
  public void process(CAS aCAS) throws AnalysisEngineProcessException {
    try {
      JCas jcas = aCAS.getJCas();
      ExperimentUUID experiment = ProcessingStepUtils.getCurrentExperiment(jcas);
      AnnotationIndex<Annotation> steps = jcas.getAnnotationIndex(ProcessingStep.type);
      String uuid = experiment.getUuid();
      Trace trace = ProcessingStepUtils.getTrace(steps);
      Key key = new Key(uuid, trace, experiment.getStageId());
      experiments.add(new ExperimentKey(key.getExperiment(), key.getStage()));
      for (TraceListener listener : listeners) {
        listener.process(key, jcas);
      }
    } catch (Exception e) {
      throw new AnalysisEngineProcessException(e);
    }
  }
1349763
public void get(
    Object rootVal,
    MatchSpaceKey msg,
    EvalCache cache,
    Object contextValue,
    SearchResults result)
    throws MatchingException, BadMessageFormatMatchingException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      tc.entry(
          this,cclass,
        "get",
        "msg: " + msg + ", result: " + result);

    // type never used so removed
    //int type;

    List[] v = alwaysMatch.lists;
    if (v.length > 0)
      result.addObjects(v);

    if (msg != null)
    {
      int numExpr = roots.size();

      for (int current = 0; current < numExpr; current++)
      {
        Boolean res = null;

        // May need to call MFP multiple times, if our context has multiple nodes
        if(contextValue != null)
        {
          // Currently this must be a list of nodes
          if (contextValue instanceof SetValEvaluationContext)
          {
            SetValEvaluationContext evalContext = (SetValEvaluationContext)contextValue;
            
            // Get the node list
            ArrayList wrappedParentList = evalContext.getWrappedNodeList(); 
            // If the list is empty, then we have yet to get the document root
            if(wrappedParentList.isEmpty())
            {
        	    //Set up a root (document) context for evaluation
            	Object docRoot = Matching.getEvaluator().getDocumentRoot(msg);
                
                // Create an object to hold the wrapped node
                WrappedNodeResults wrapper = new WrappedNodeResults(docRoot);
                // Set the root into the evaluation context
                evalContext.addNode(wrapper);
            }
            
            // Iterate over the nodes
            Iterator iter = wrappedParentList.iterator();

            while(iter.hasNext())
            {
              WrappedNodeResults nextWrappedNode = (WrappedNodeResults)iter.next();       
              Object nextNode = nextWrappedNode.getNode();
                
                
              // If no cached value we'll need to call MFP
              //TODO: No caching here

              // Call MFP to get the results for this node
              res = 
                (Boolean) Matching.
                  getEvaluator().
                    eval((Selector) roots.get(current),
                         msg,
                         cache,
                         nextNode,
                         true); // Permissive is true  

              if(res !=null && res.booleanValue())
              {
                break;
              }     
     
            } // eof while
          } // eof instanceof XPathEvaluationContext
        }
        else
        {
          res = (Boolean) Matching.getEvaluator().eval(
              (Selector) roots.get(current),
              msg,
              cache,
              contextValue,
              false);            
        }
        
        if (res != null && res.booleanValue())
        {
          MatchTargetTypeList tlist = (MatchTargetTypeList) objs.get(current);
          v = tlist.lists;
          if (v.length > 0)
            result.addObjects(v);
        }
      }
    }
    // ContinueBranch has to be last to treat this node as if it was at the end of
    // a long chain of *, or a #.
    super.get(null, msg, cache, contextValue, result);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      tc.exit(this,cclass, "get");

  }
331574
private void processProjectProperties() throws MPXJException, IOException
   {
      Props8 props = new Props8(new DocumentInputStream(((DocumentEntry) m_projectDir.getEntry("Props"))));
      ProjectPropertiesReader reader = new ProjectPropertiesReader();
      reader.process(m_file, props, m_root);
   }
75972
private void evaluateExpressions() throws JspException {
        /*
         * Note: we don't check for type mismatches here; we assume
         * the expression evaluator will return the expected type
         * (by virtue of knowledge we give it about what that type is).
         * A ClassCastException here is truly unexpected, so we let it
         * propagate up.
         */

        if (begin_ != null) {
            Object r = ExpressionEvaluatorManager.evaluate(
                    "begin", begin_, Integer.class, this, pageContext);
            if (r == null) {
                throw new NullAttributeException("forTokens", "begin");
            }
            begin = ((Integer) r).intValue();
            validateBegin();
        }

        if (end_ != null) {
            Object r = ExpressionEvaluatorManager.evaluate(
                    "end", end_, Integer.class, this, pageContext);
            if (r == null) {
                throw new NullAttributeException("forTokens", "end");
            }
            end = ((Integer) r).intValue();
            validateEnd();
        }

        if (step_ != null) {
            Object r = ExpressionEvaluatorManager.evaluate(
                    "step", step_, Integer.class, this, pageContext);
            if (r == null) {
                throw new NullAttributeException("forTokens", "step");
            }
            step = ((Integer) r).intValue();
            validateStep();
        }

        if (items_ != null) {
            items = (String) ExpressionEvaluatorManager.evaluate(
                    "items", items_, String.class, this, pageContext);
            // use the empty string to indicate "no iteration"
            if (items == null) {
                items = "";
            }
        }

        if (delims_ != null) {
            delims = (String) ExpressionEvaluatorManager.evaluate(
                    "delims", delims_, String.class, this, pageContext);
            // use the empty string to cause monolithic tokenization
            if (delims == null) {
                delims = "";
            }
        }
    }
535371
def ReadFlowResults(self,
                      client_id,
                      flow_id,
                      offset,
                      count,
                      with_tag=None,
                      with_type=None,
                      with_substring=None):
    """"""
    results = sorted(
        [x.Copy() for x in self.flow_results.get((client_id, flow_id), [])],
        key=lambda r: r.timestamp)

    # This is done in order to pass the tests that try to deserialize
    # value of an unrecognized type.
    for r in results:
      cls_name = compatibility.GetName(r.payload.__class__)
      if cls_name not in rdfvalue.RDFValue.classes:
        r.payload = rdf_objects.SerializedValueOfUnrecognizedType(
            type_name=cls_name, value=r.payload.SerializeToString())

    if with_tag is not None:
      results = [i for i in results if i.tag == with_tag]

    if with_type is not None:
      results = [
          i for i in results
          if compatibility.GetName(i.payload.__class__) == with_type
      ]

    if with_substring is not None:
      encoded_substring = with_substring.encode("utf8")
      results = [
          i for i in results
          if encoded_substring in i.payload.SerializeToString()
      ]

    return results[offset:offset + count]
1172003
void analyze(final MethodResult methodResult) {
        lock.lock();
        try {
            buildPackagePrefix(methodResult.getParentResource().getOriginalClass());

            determineReturnTypes(methodResult).stream()
                    // FEATURE handle several sub-resource impl's
                    .reduce((l, r) -> JavaUtils.determineMostSpecificType(l, r))
                    .ifPresent(t -> registerSubResourceJob(t, methodResult.getSubResource()));
        } finally {
            lock.unlock();
        }
    }
1087540
private void evaluateExpressions() throws JspException {
        /* 
         * Note: we don't check for type mismatches here; we assume
         * the expression evaluator will return the expected type
         * (by virtue of knowledge we give it about what that type is).
         * A ClassCastException here is truly unexpected, so we let it
         * propagate up.
         */

        if (keySpecified) {
            keyAttrValue = (String) ExpressionEvaluatorManager.evaluate(
                    "key", key_, String.class, this, pageContext);
        }

        if (bundleSpecified) {
            bundleAttrValue = (LocalizationContext)
                    ExpressionEvaluatorManager.evaluate(
                            "bundle", bundle_, LocalizationContext.class, this,
                            pageContext);
        }
    }
683596
def read(self):
        ''''''
        responses = self._read()
        # Determine the number of messages in here and decrement our ready
        # count appropriately
        self.ready -= sum(
            map(int, (r.frame_type == Message.FRAME_TYPE for r in responses)))
        return responses
828039
private void readMethods() throws IOException, ClassfileFormatException {
        // Methods
        final int methodCount = inputStreamOrByteBuffer.readUnsignedShort();
        for (int i = 0; i < methodCount; i++) {
            // Info on modifier flags: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.6
            final int methodModifierFlags = inputStreamOrByteBuffer.readUnsignedShort();
            final boolean isPublicMethod = ((methodModifierFlags & 0x0001) == 0x0001);
            final boolean methodIsVisible = isPublicMethod || scanSpec.ignoreMethodVisibility;

            String methodName = null;
            String methodTypeDescriptor = null;
            String methodTypeSignature = null;
            // Always enable MethodInfo for annotations (this is how annotation constants are defined)
            final boolean enableMethodInfo = scanSpec.enableMethodInfo || isAnnotation;
            if (enableMethodInfo || isAnnotation) { // Annotations store defaults in method_info
                final int methodNameCpIdx = inputStreamOrByteBuffer.readUnsignedShort();
                methodName = getConstantPoolString(methodNameCpIdx);
                final int methodTypeDescriptorCpIdx = inputStreamOrByteBuffer.readUnsignedShort();
                methodTypeDescriptor = getConstantPoolString(methodTypeDescriptorCpIdx);
            } else {
                inputStreamOrByteBuffer.skip(4); // name_index, descriptor_index
            }
            final int attributesCount = inputStreamOrByteBuffer.readUnsignedShort();
            String[] methodParameterNames = null;
            int[] methodParameterModifiers = null;
            AnnotationInfo[][] methodParameterAnnotations = null;
            AnnotationInfoList methodAnnotationInfo = null;
            boolean methodHasBody = false;
            if (!methodIsVisible || (!enableMethodInfo && !isAnnotation)) {
                // Skip method attributes
                for (int j = 0; j < attributesCount; j++) {
                    inputStreamOrByteBuffer.skip(2); // attribute_name_index
                    final int attributeLength = inputStreamOrByteBuffer.readInt();
                    inputStreamOrByteBuffer.skip(attributeLength);
                }
            } else {
                // Look for method annotations
                for (int j = 0; j < attributesCount; j++) {
                    final int attributeNameCpIdx = inputStreamOrByteBuffer.readUnsignedShort();
                    final int attributeLength = inputStreamOrByteBuffer.readInt();
                    if (scanSpec.enableAnnotationInfo
                            && (constantPoolStringEquals(attributeNameCpIdx, "RuntimeVisibleAnnotations")
                                    || (!scanSpec.disableRuntimeInvisibleAnnotations && constantPoolStringEquals(
                                            attributeNameCpIdx, "RuntimeInvisibleAnnotations")))) {
                        final int methodAnnotationCount = inputStreamOrByteBuffer.readUnsignedShort();
                        if (methodAnnotationCount > 0) {
                            if (methodAnnotationInfo == null) {
                                methodAnnotationInfo = new AnnotationInfoList(1);
                            }
                            for (int k = 0; k < methodAnnotationCount; k++) {
                                final AnnotationInfo annotationInfo = readAnnotation();
                                methodAnnotationInfo.add(annotationInfo);
                            }
                        }
                    } else if (scanSpec.enableAnnotationInfo
                            && (constantPoolStringEquals(attributeNameCpIdx, "RuntimeVisibleParameterAnnotations")
                                    || (!scanSpec.disableRuntimeInvisibleAnnotations && constantPoolStringEquals(
                                            attributeNameCpIdx, "RuntimeInvisibleParameterAnnotations")))) {
                        // Merge together runtime visible and runtime invisible annotations into a single array
                        // of annotations for each method parameter (runtime visible and runtime invisible
                        // annotations are given in separate attributes, so if both attributes are present,
                        // have to make the parameter annotation arrays larger when the second attribute is
                        // encountered).
                        final int numParams = inputStreamOrByteBuffer.readUnsignedByte();
                        if (methodParameterAnnotations == null) {
                            methodParameterAnnotations = new AnnotationInfo[numParams][];
                        } else if (methodParameterAnnotations.length != numParams) {
                            throw new ClassfileFormatException(
                                    "Mismatch in number of parameters between RuntimeVisibleParameterAnnotations "
                                            + "and RuntimeInvisibleParameterAnnotations");
                        }
                        for (int paramIdx = 0; paramIdx < numParams; paramIdx++) {
                            final int numAnnotations = inputStreamOrByteBuffer.readUnsignedShort();
                            if (numAnnotations > 0) {
                                int annStartIdx = 0;
                                if (methodParameterAnnotations[paramIdx] != null) {
                                    annStartIdx = methodParameterAnnotations[paramIdx].length;
                                    methodParameterAnnotations[paramIdx] = Arrays.copyOf(
                                            methodParameterAnnotations[paramIdx], annStartIdx + numAnnotations);
                                } else {
                                    methodParameterAnnotations[paramIdx] = new AnnotationInfo[numAnnotations];
                                }
                                for (int annIdx = 0; annIdx < numAnnotations; annIdx++) {
                                    methodParameterAnnotations[paramIdx][annStartIdx + annIdx] = readAnnotation();
                                }
                            } else if (methodParameterAnnotations[paramIdx] == null) {
                                methodParameterAnnotations[paramIdx] = NO_ANNOTATIONS;
                            }
                        }
                    } else if (constantPoolStringEquals(attributeNameCpIdx, "MethodParameters")) {
                        // Read method parameters. For Java, these are only produced in JDK8+, and only if the
                        // commandline switch `-parameters` is provided at compiletime.
                        final int paramCount = inputStreamOrByteBuffer.readUnsignedByte();
                        methodParameterNames = new String[paramCount];
                        methodParameterModifiers = new int[paramCount];
                        for (int k = 0; k < paramCount; k++) {
                            final int cpIdx = inputStreamOrByteBuffer.readUnsignedShort();
                            // If the constant pool index is zero, then the parameter is unnamed => use null
                            methodParameterNames[k] = cpIdx == 0 ? null : getConstantPoolString(cpIdx);
                            methodParameterModifiers[k] = inputStreamOrByteBuffer.readUnsignedShort();
                        }
                    } else if (constantPoolStringEquals(attributeNameCpIdx, "Signature")) {
                        // Add type params to method type signature
                        methodTypeSignature = getConstantPoolString(inputStreamOrByteBuffer.readUnsignedShort());
                    } else if (constantPoolStringEquals(attributeNameCpIdx, "AnnotationDefault")) {
                        if (annotationParamDefaultValues == null) {
                            annotationParamDefaultValues = new AnnotationParameterValueList();
                        }
                        this.annotationParamDefaultValues.add(new AnnotationParameterValue(methodName,
                                // Get annotation parameter default value
                                readAnnotationElementValue()));
                    } else if (constantPoolStringEquals(attributeNameCpIdx, "Code")) {
                        methodHasBody = true;
                        inputStreamOrByteBuffer.skip(attributeLength);
                    } else {
                        inputStreamOrByteBuffer.skip(attributeLength);
                    }
                }
                // Create MethodInfo
                if (enableMethodInfo) {
                    if (methodInfoList == null) {
                        methodInfoList = new MethodInfoList();
                    }
                    methodInfoList.add(new MethodInfo(className, methodName, methodAnnotationInfo,
                            methodModifierFlags, methodTypeDescriptor, methodTypeSignature, methodParameterNames,
                            methodParameterModifiers, methodParameterAnnotations, methodHasBody));
                }
            }
        }
    }
715901
def _parse_response(self, results):
        

        dict_response = results.get("response")
        result_obj = SolrResults()
        result_obj.query_time = results.get("responseHeader").get("QTime", None)
        result_obj.results_count = dict_response.get("numFound", 0)
        result_obj.start_index = dict_response.get("start", 0)

        for doc in dict_response.get("docs", []):
            result_obj.documents.append(doc)

        # Process facets
        if "facet_counts" in results:
            facet_types = ["facet_fields", "facet_dates", "facet_ranges", "facet_queries"]
            for type in facet_types:
                assert type in results.get("facet_counts")
                items = results.get("facet_counts").get(type)
                for field, values in items.items():
                    result_obj.facets[field] = []

                    # Range facets have results in "counts" subkey and "between/after" on top level. Flatten this.
                    if type == "facet_ranges":
                        if not "counts" in values:
                            continue

                        for facet, value in values["counts"].items():
                            result_obj.facets[field].append((facet, value))

                        if "before" in values:
                            result_obj.facets[field].append(("before", values["before"]))

                        if "after" in values:
                            result_obj.facets[field].append(("after", values["after"]))
                    else:
                        for facet, value in values.items():
                            # Date facets have metadata fields between the results, skip the params, keep "before" and "after" fields for other
                            if type == "facet_dates" and \
                            (facet == "gap" or facet == "between" or facet == "start" or facet == "end"):
                                continue
                            result_obj.facets[field].append((facet, value))

        # Process highlights
        if "highlighting" in results:
            for key, value in results.get("highlighting").items():
                result_obj.highlights[key] = value

        return result_obj
1329072
private void _processMetadata(HashMap<String, Object> result) {
		// the collections in the result can be either an object[] or a HashSet<object>, depending on the serializer that is used
		Object methods = result.get("methods");
		Object attrs = result.get("attrs");
		Object oneways = result.get("oneways");

		if(methods instanceof Object[]) {
			Object[] methods_array = (Object[]) methods;
			this.pyroMethods = new HashSet<String>();
			for(int i=0; i<methods_array.length; ++i) {
				this.pyroMethods.add((String) methods_array[i]);
			}
		} else if(methods!=null) {
			this.pyroMethods = getSetOfStrings(methods);
		}
		if(attrs instanceof Object[]) {
			Object[] attrs_array = (Object[]) attrs;
			this.pyroAttrs = new HashSet<String>();
			for(int i=0; i<attrs_array.length; ++i) {
				this.pyroAttrs.add((String) attrs_array[i]);
			}
		} else if(attrs!=null) {
			this.pyroAttrs = getSetOfStrings(attrs);
		}
		if(oneways instanceof Object[]) {
			Object[] oneways_array = (Object[]) oneways;
			this.pyroOneway = new HashSet<String>();
			for(int i=0; i<oneways_array.length; ++i) {
				this.pyroOneway.add((String) oneways_array[i]);
			}
		} else if(oneways!=null) {
			this.pyroOneway = getSetOfStrings(oneways);
		}

		if(pyroMethods.isEmpty() && pyroAttrs.isEmpty()) {
			throw new PyroException("remote object doesn't expose any methods or attributes");
		}
	}
288800
@Override
    public GraphQueryResult evaluate()
            throws QueryEvaluationException {
        try {
            sync();
            return getMarkLogicClient().sendGraphQuery(getQueryString(),getBindings(),getIncludeInferred(),getBaseURI());
        } catch (IOException e) {
            throw new QueryEvaluationException(e);
        } catch (MarkLogicSesameException e) {
            throw new QueryEvaluationException(e);
        }
    }
1374625
private void loadSeqEvalParameters() {
    this.seqevalParser.addArgument("--metric").required(false)
        .choices("accuracy", "fmeasure").setDefault("fmeasure").help(
            "Choose evaluation metric for Sequence Labeler; it defaults to fmeasure.\n");
    this.seqevalParser.addArgument("-l", "--language").required(true)
        .choices("de", "en", "es", "eu", "gl", "it", "nl").help("Choose language.\n");
    this.seqevalParser.addArgument("-m", "--model").required(false)
        .setDefault(Flags.DEFAULT_EVALUATE_MODEL)
        .help("Pass the model to evaluate as a parameter.\n");
    this.seqevalParser.addArgument("-t", "--testset").required(true)
        .help("The test or reference corpus.\n");
    this.seqevalParser.addArgument("--clearFeatures").required(false)
        .choices("yes", "no", "docstart").setDefault(Flags.DEFAULT_FEATURE_FLAG)
        .help("Reset the adaptive features; defaults to 'no'.\n");
    this.seqevalParser.addArgument("-f", "--corpusFormat").required(false)
        .choices("conll02", "conll03", "lemmatizer", "tabulated")
        .setDefault(Flags.DEFAULT_EVAL_FORMAT).help(
            "Choose format of reference corpus; it defaults to conll02 format.\n");
    this.seqevalParser.addArgument("--evalReport").required(false)
        .choices("brief", "detailed", "error").help(
            "Choose level of detail of evaluation report; it defaults to detailed evaluation.\n");
    this.seqevalParser.addArgument("--types").required(false)
        .setDefault(Flags.DEFAULT_SEQUENCE_TYPES).help(
            "Choose which Sequence types used for evaluation; the argument must be a comma separated"
                + " string; e.g., 'person,organization'.\n");
    this.seqevalParser.addArgument("-u", "--unknownAccuracy").required(false)
        .setDefault(Flags.DEFAULT_FEATURE_FLAG).help(
            "Pass the model training set to evaluate unknown and known word accuracy.\n");
  }
1024151
public void process(CAS tcas) {

		String text = tcas.getDocumentText();
		Document document = new DocumentImpl(text);

		cogroo.analyze(document);

		for (Sentence sentence : document.getSentences()) {

			// create sentence annotations
			AnnotationFS sentenceAnn = tcas.createAnnotation(mSentenceType,
					sentence.getStart(), sentence.getEnd());
			tcas.getIndexRepository().addFS(sentenceAnn);

			int sentenceOffset = sentence.getStart();

			AnnotationFS[] tokenAnnotationArr = new AnnotationFS[sentence
					.getTokens().size()];
			int i = 0;
			for (Token token : sentence.getTokens()) {
				// create token annotations
				tokenAnnotationArr[i] = tcas.createAnnotation(mTokenType,
						sentenceOffset + token.getStart(), sentenceOffset
								+ token.getEnd());

				// add POSTag annotations
				tokenAnnotationArr[i].setStringValue(this.mPosFeature,
						token.getPOSTag());

				// add lexeme annotations
				tokenAnnotationArr[i].setStringValue(this.mLexemeFeature,
						token.getLexeme());

				// add lemma annotations
				StringArrayFS lemmas = tcas.createStringArrayFS(token
						.getLemmas().length);
				lemmas.copyFromArray(token.getLemmas(), 0, 0,
						token.getLemmas().length);
				tokenAnnotationArr[i].setFeatureValue(this.mLemmaFeature,
						lemmas);

				tokenAnnotationArr[i].setStringValue(this.mFeaturesFeature,
						token.getFeatures());

				tcas.getIndexRepository().addFS(tokenAnnotationArr[i]);
				i++;
			}

			// chunks
			for (Chunk chunk : sentence.getChunks()) {

				int start = sentence.getTokens().get(chunk.getStart())
						.getStart()
						+ sentenceOffset;
				int end = sentence.getTokens().get(chunk.getEnd() - 1).getEnd()
						+ sentenceOffset;

				AnnotationFS chunkAnn = tcas.createAnnotation(mChunkType,
						start, end);

				chunkAnn.setStringValue(mChunkFeature, chunk.getTag());

				if(chunk.getHeadIndex() >= 0) {
					chunkAnn.setFeatureValue(mChunkHead,
							tokenAnnotationArr[chunk.getHeadIndex()]);
				}

				tcas.getIndexRepository().addFS(chunkAnn);
			}

			// syntactic chunk
			for (SyntacticChunk sc : sentence.getSyntacticChunks()) {
				int start = sentence.getTokens().get(sc.getStart()).getStart()
						+ sentenceOffset;
				int end = sentence.getTokens().get(sc.getEnd() - 1).getEnd()
						+ sentenceOffset;

				AnnotationFS syntChunkAnn = tcas.createAnnotation(
						mSyntacticChunkType, start, end);

				syntChunkAnn.setStringValue(mSyntacticChunkFeature, sc.getTag());

				tcas.getIndexRepository().addFS(syntChunkAnn);
			}
		}
	}
772350
public void processDocument(BufferedReader document) throws IOException {
        int docIndex = documentCounter.getAndIncrement();

        Iterator<String> documentTokens = 
            IteratorFactory.tokenizeOrdered(document);

        // As we read in the document, generate a compressed version of it,
        // which we will use during the process space method to recompute all of
        // the word vectors' semantics
        ByteArrayOutputStream compressedDocument = 
            new ByteArrayOutputStream(4096);
        DataOutputStream dos = new DataOutputStream(compressedDocument);
        int tokens = 0; // count how many are in this document
        int unfilteredTokens = 0; // how many tokens remained after filtering

        IntegerVector docVector = createVector();
        docToVector.put(docIndex, docVector);

        while (documentTokens.hasNext()) {
            tokens++;
            String focusWord = documentTokens.next();

            // If we are filtering the semantic vectors, check whether this word
            // should have its semantics calculated.  In addition, if there is a
            // filter and it would have excluded the word, do not keep its
            // semantics around
            boolean calculateSemantics =
                semanticFilter.isEmpty() || semanticFilter.contains(focusWord)
                && !focusWord.equals(IteratorFactory.EMPTY_TOKEN);

	    // If the filter does not accept this word, skip the semantic
	    // processing, continue with the next word
            if (!calculateSemantics) {
                // Do not write out any removed tokens to save space
		continue;
	    }

            // Update the occurrences of this token
            unfilteredTokens++;
            add(docVector, getTermIndexVector(focusWord));

            // Update the compress version of the document with the token.
            //
            // NOTE: this call to termToIndex *must* come after the
            // getTermIndexVector() call, which is responsible for adding this
            // mapping if it doesn't already exist.
	    int focusIndex = termToIndex.get(focusWord);

            // write the term index into the compressed for the document for
            // later corpus reprocessing
            dos.writeInt(focusIndex);
        }

        document.close();
        
        dos.close();
        byte[] docAsBytes = compressedDocument.toByteArray();

        // Once the document is finished, write the compressed contents to the
        // corpus stream
        synchronized(compressedDocumentsWriter) {
            // Write how many terms were in this document after filtering
            compressedDocumentsWriter.writeInt(unfilteredTokens);
            compressedDocumentsWriter.write(docAsBytes, 0, docAsBytes.length);
        }
    }
1171035
private void parseViewInfo() {
        int rowsStart = -1;
        for (int i = responseContent.readerIndex(); i < responseContent.writerIndex() - 2; i++) {
            byte curr = responseContent.getByte(i);
            byte f1 = responseContent.getByte(i + 1);
            byte f2 = responseContent.getByte(i + 2);

            if (curr == '"' && f1 == 'r' && f2 == 'o') {
                rowsStart = i;
                break;
            }
        }

        if (rowsStart == -1) {
            return;
        }

        ByteBuf info = responseContent.readBytes(rowsStart - responseContent.readerIndex());
        int closingPointer = info.forEachByteDesc(new ByteBufProcessor() {
            @Override
            public boolean process(byte value) throws Exception {
                return value != ',';
            }
        });

        if (closingPointer > 0) {
            info.setByte(closingPointer, '}');
            viewInfoObservable.onNext(info);
        } else {
            //JVMCBC-360 don't forget to release the now unused info ByteBuf
            info.release();
            viewInfoObservable.onNext(Unpooled.EMPTY_BUFFER);
        }
        viewInfoObservable.onCompleted();
        viewParsingState = QUERY_STATE_ROWS;
    }
1067254
public function read()
    {
        if ($this->isExistingMetricsFile()) {
            $this->_resetTotalValues();

            foreach ($this->_oMetrics->package as $oPackage) {
                $this->_readClassMetricsPerPackage($oPackage);
            }
        }
    }