Returns the {@link TermDocs} for the given term.

@param t the term.
@return the term docs for the given term.
@throws IOException if an error occurs while reading from the index.
185699
@SuppressWarnings("unchecked")
   public TermDocs termDocs(final Term t) throws IOException
   {
      if (t==null || t.field() != field)
      {
         return reader.termDocs(t);
      }

      String text = t.text();
      if (unknownValues.get(text) != null)
      {
         log.debug("EmptyTermDocs({},{})", field, text);
         return EmptyTermDocs.INSTANCE;
      }

      // maintain cache
      CacheEntry entry;
      synchronized (cache)
      {
         entry = (CacheEntry)cache.get(text);
         if (entry == null)
         {
            // check space
            if (cache.size() >= CACHE_SIZE)
            {
               // prune half of them and adjust the rest
               CacheEntry[] entries = (CacheEntry[])cache.values().toArray(new CacheEntry[cache.size()]);
               Arrays.sort(entries);
               int threshold = entries[CACHE_SIZE / 2].numAccessed;
               for (Iterator<Map.Entry<String, CacheEntry>> it = cache.entrySet().iterator(); it.hasNext();)
               {
                  Map.Entry<String, CacheEntry> e = it.next();
                  if (e.getValue().numAccessed <= threshold)
                  {
                     // prune
                     it.remove();
                  }
                  else
                  {
                     // adjust
                     CacheEntry ce = (CacheEntry)e.getValue();
                     ce.numAccessed = (int)Math.sqrt(ce.numAccessed);
                  }
               }
            }
            entry = new CacheEntry();
            cache.put(text, entry);
         }
         else
         {
            entry.numAccessed++;
         }
      }

      // this is a threshold to prevent caching of TermDocs
      // that are read only irregularly.
      if (entry.numAccessed < 10)
      {
         if (log.isDebugEnabled())
         {
            log.debug("#{} TermDocs({},{})", new Object[]{new Integer(entry.numAccessed), field, text});
         }
         return reader.termDocs(t);
      }

      if (entry.bits == null)
      {
         // collect bits
         BitSet bits = null;
         TermDocs tDocs = reader.termDocs(t);
         try
         {
            while (tDocs.next())
            {
               if (bits == null)
               {
                  bits = new BitSet(reader.maxDoc());
               }
               bits.set(tDocs.doc());
            }
         }
         finally
         {
            tDocs.close();
         }
         if (bits != null)
         {
            entry.bits = bits;
         }
      }

      if (entry.bits == null)
      {
         // none collected
         unknownValues.put(text, text);
         return EmptyTermDocs.INSTANCE;
      }
      else
      {
         if (log.isDebugEnabled())
         {
            log.debug("CachedTermDocs({},{},{}/{})", new Object[]{field, text, new Integer(entry.bits.cardinality()),
               new Integer(reader.maxDoc())});
         }
         return new CachedTermDocs(entry.bits);
      }
   }
659103
public static <TERM> Map<TERM, Double> tf(Collection<TERM> document)
    {
        return tf(document, TfType.NATURAL);
    }
1313035
public Map<String, Object> getDocument(String collectionName, String docId) {
        Map<String, Map<String,Object>> docs = DDPStateSingleton.getInstance()
                .getCollection(collectionName);
        if (docs != null) {
            return docs.get(docId);
        }
        return null;
    }
1189550
@SuppressWarnings("unchecked")
    private void processSpace() throws IOException {
        compressedDocumentsWriter.close();        

        // Generate the reverse index-to-term mapping.  We will need this for
        // assigning specific senses to each term
        String[] indexToTerm = new String[termToIndex.size()];
        for (Map.Entry<String,Integer> e : termToIndex.entrySet())
            indexToTerm[e.getValue()] = e.getKey();
        
        // Compute how many terms were in the corpus.  We will need this for
        // determining the log-likelihood for all co-occurrences.
        int corpusSize = 0;
        for (AtomicInteger i : termCounts)
            corpusSize += i.get();
        final int uniqueTerms = cooccurrenceMatrix.rows();

        LOGGER.info("calculating term features");
        // Create a set for each term that contains the term indices that are
        // determined to be features for the term, i.e. not all co-occurrences
        // will count as the features.  The feature set for each term is
        // determined by computing the log-likelihood for each co-occurrence and
        // only keeping those terms whos l-l value is above a certain threshold.
        final BitSet[] termFeatures = new BitSet[wordIndexCounter];        
        for (int termIndex = 0; termIndex < uniqueTerms; ++termIndex) {
            String term = indexToTerm[termIndex];            
            termFeatures[termIndex] = calculateTermFeatures(term, corpusSize);
        }

        LOGGER.info("reprocessing corpus to generate feature vectors");
        
        // Set up the concurrent data structures so we can process the documents
        // concurrently
        final BlockingQueue<Runnable> workQueue =
            new LinkedBlockingQueue<Runnable>();
        for (int i = 0; i < Runtime.getRuntime().availableProcessors(); ++i) {
            Thread t = new WorkerThread(workQueue);
            t.start();
        }
        final Semaphore termsProcessed = new Semaphore(0); 
        
        for (int termIndex = 0; termIndex < uniqueTerms; ++termIndex) {
            
            final String term = indexToTerm[termIndex];
            final int i = termIndex;
            workQueue.offer(new Runnable() {
                    public void run() {
                        try {
                        LOGGER.fine(String.format(
                            "processing term %6d/%d: %s", i, uniqueTerms,term));
                        Matrix contexts = getTermContexts(i, termFeatures[i]);
                        senseInduce(term, contexts);
                        } catch (IOException ioe) {
                            ioe.printStackTrace();
                        } finally {
                            termsProcessed.release();
                        }                       
                    }
                });
        }
        
        // Wait until all the documents have been processed
        try {
            termsProcessed.acquire(uniqueTerms);
        } catch (InterruptedException ie) {
            throw new Error("interrupted while waiting for terms to " +
                            "finish reprocessing", ie);
        }        
        LOGGER.info("finished reprocessing all terms");
    }
704126
public List<Term> getAllTerms() {
        List<Term> ret = new ArrayList<Term>();

        if (terms != null) {
            ret.addAll(terms);
            for (final Term term : terms) {
                ret.addAll(term.getAllTerms());
            }
        }

        return ret;
    }
758254
public static List<Term> getSubTerm(Term from, Term to) {
		
		List<Term> subTerm = new ArrayList<Term>(3);

		while ((from = from.to()) != to) {
			subTerm.add(from);
		}

		return subTerm;
	}
895559
public ListDocumentsResponse listDocuments() {
        ListDocumentsRequest request = new ListDocumentsRequest();
        InternalRequest internalRequest = this.createRequest(HttpMethodName.GET, request, DOC);
        ListDocumentsResponse response;
        try {
            response = this.invokeHttpClient(internalRequest, ListDocumentsResponse.class);
        } finally {
            try {
                internalRequest.getContent().close();
            } catch (Exception e) {
                // ignore exception
            }
        }

        return response;
    }
40937
@Override
    public ClassDoc asClassDoc() {
        return env.getClassDoc((ClassSymbol)env.types.erasure(type).tsym);
    }
956585
public <T extends TermStream> T getTermStream(T reusableTermStream) {
    reusableTermStream.set(this.getAtomicReaderId(), this.getAtomicDocId());
    return reusableTermStream;
  }
1356411
int toMatchDoc() throws IOException {
    while (true) {
      if (findMatches()) {
        return docID();
      }
      resetQueue();
      if (spans.nextDoc() == NO_MORE_DOCS) {
        return NO_MORE_DOCS;
      }
    }
  }
687683
public List<Term> getTermsFromWFs(List<String> wfIds) {
	List<Term> terms = new ArrayList<Term>();
	for (String wfId : wfIds) {
	    terms.addAll(this.wfId2Terms.get(wfId));
	}
	return terms;
    }
367181
public List<Integer> getParameterIndexes(final int tid) {
        List<Integer> ret = termParameterIndex.get(tid);
        if (ret == null) {
            ret = emptyList();
        }
        return unmodifiableList(ret);
    }
1288561
private static List<List<String>> convertSentenceListToDocument(List<String> sentenceList)
    {
        List<List<String>> docs = new ArrayList<List<String>>(sentenceList.size());
        for (String sentence : sentenceList)
        {
            List<Term> termList = StandardTokenizer.segment(sentence.toCharArray());
            List<String> wordList = new LinkedList<String>();
            for (Term term : termList)
            {
                if (CoreStopWordDictionary.shouldInclude(term))
                {
                    wordList.add(term.word);
                }
            }
            docs.add(wordList);
        }
        return docs;
    }
1232740
def doc(self):
        """"""
        from metatab import MetatabDoc
        t = self.get_resource().get_target()
        return MetatabDoc(t.inner)
960494
def get_documents(self, term):
        
        if term not in self._terms:
            raise IndexError(TERM_DOES_NOT_EXIST)
        else:
            return self._terms[term]
428422
public Set<String> getOtLabelAndSynonyms(OntologyTerm ontologyTerm) {
    Set<String> allTerms = Sets.newLinkedHashSet(ontologyTerm.getSynonyms());
    allTerms.add(ontologyTerm.getLabel());
    return allTerms;
  }
843811
public static tmtrafficaction[] get(nitro_service service) throws Exception{
		tmtrafficaction obj = new tmtrafficaction();
		tmtrafficaction[] response = (tmtrafficaction[])obj.get_resources(service);
		return response;
	}