Codota Logo
LongRef.asLong
Code IndexAdd Codota to your IDE (free)

How to use
asLong
method
in
edu.berkeley.nlp.lm.util.LongRef

Best Java code snippets using edu.berkeley.nlp.lm.util.LongRef.asLong (Showing top 3 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: languagetool-org/languagetool

@Override
public long getCount(List<String> tokens) {
 LongRef count = map.get(tokens);
 long result;
 if (count == null) {
  result = 0;
 } else {
  result = count.asLong();
 }
 //System.out.println(tokens + " -> " + result);
 return result;
}
origin: org.languagetool/languagetool-core

@Override
public long getCount(List<String> tokens) {
 LongRef count = map.get(tokens);
 long result;
 if (count == null) {
  result = 0;
 } else {
  result = count.asLong();
 }
 //System.out.println(tokens + " -> " + result);
 return result;
}
origin: edu.berkeley.nlp/berkeleylm

public CountValueContainer(final LongToIntHashMap countCounter, final int valueRadix, final boolean storePrefixes, final long[] numNgramsForEachOrder) {
  super(valueRadix, storePrefixes, numNgramsForEachOrder);
  final boolean hasDefaultVal = countCounter.get(getDefaultVal().asLong(), -1) >= 0;
  countsForRank = new long[countCounter.size() + (hasDefaultVal ? 0 : 1)];
  countIndexer = new LongToIntHashMap();
  int k = 0;
  for (final Entry pair : countCounter.getObjectsSortedByValue(true)) {
    countIndexer.put(pair.key, countIndexer.size());
    countsForRank[k++] = pair.key;
    if (countIndexer.size() == defaultValRank && !hasDefaultVal) {
      countIndexer.put(getDefaultVal().asLong(), countIndexer.size());
      countsForRank[k++] = getDefaultVal().asLong();
    }
  }
  if (countIndexer.size() < defaultValRank && !hasDefaultVal) {
    countIndexer.put(getDefaultVal().asLong(), countIndexer.size());
    countsForRank[k++] = getDefaultVal().asLong();
  }
  valueWidth = CustomWidthArray.numBitsNeeded(countIndexer.size());
}
edu.berkeley.nlp.lm.utilLongRefasLong

Popular methods of LongRef

  • <init>

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setContentView (Activity)
  • onCreateOptionsMenu (Activity)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now