Codota Logo
PassageKeyFactory.normalize
Code IndexAdd Codota to your IDE (free)

How to use
normalize
method
in
org.crosswire.jsword.passage.PassageKeyFactory

Best Java code snippets using org.crosswire.jsword.passage.PassageKeyFactory.normalize (Showing top 1 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: crosswire/jsword

/**
 * Convert the passageReference into a Passage. This is the recommended
 * form for understanding references in ThML and GBF.
 * 
 * @param v11n
 *            The Versification to which this Passage belongs.
 * @param passageReference
 *            A String containing the text for the Passage
 * @param basis
 *           The basis by which to interpret passageReference
 * @return a new Passage filled with the desired Verses
 * @throws NoSuchKeyException
 *             If the passageReference has anything that could not be understood as a Verse
 */
public Passage getKey(Versification v11n, String passageReference, Key basis) throws NoSuchKeyException {
  // since normalization is relatively expensive
  // don't try it unless it solves a problem.
  try {
    return defaultType.createPassage(v11n, passageReference, basis);
  } catch (NoSuchKeyException e) {
    try {
      return defaultType.createPassage(v11n, normalize(passageReference), basis);
    } catch (NoSuchKeyException ex) {
      // TODO(DM): Parser should allow valid osisRefs!
      return defaultType.createPassage(v11n, mungOsisRef(passageReference), basis);
    }
  }
}
org.crosswire.jsword.passagePassageKeyFactorynormalize

Javadoc

The internals of a Passage require that references are separated with a reference delimiter. However, people and other systems may not be so stringent. So we want to allow for "Ge 1:26 3:22 11:7 20:13 31:7, 53 35:7" (which is from Clarke) This should become "Ge 1:26, 3:22, 11:7, 20:13, 31:7, 53, 35:7" Basically, the rule of thumb is that if two numbers are found separated by whitespace then add a comma between them. One note $, and ff are taken to be numbers. But it is complicated by Book names that are like 1 Cor And by verse references like Gen 1.2 Gen.1.2 Gen 1 2 which are all equivalent. So we use a counter when we see a number, if the counter reaches 2 and then we see a name or a number we emit a reference delimiter.

Popular methods of PassageKeyFactory

  • getKey
    Convert the passageReference into a Passage. This is the recommended form for understanding referenc
  • instance
    This PassageKeyFactory is accessed through this instance.
  • createEmptyKeyList
    Create an empty list of keys for the v11n
  • getValidKey
    Convert the passageReference into a Passage or an empty Passage, if there is an error. Note, this is
  • setDefaultType
    Set the default PassageType
  • binarySize
    Write to buffer (starting at index) the given number using a set of bytes as required by the max pos
  • fromBinary
    Read and return an int from the buffer (starting at index[0]) using a set of bytes as required by th
  • getGlobalKeyList
    Get a Passage containing all the Verses in this Versification. This differs from org.crosswire.jswor
  • mungOsisRef
    Replace spaces with semi-colons, because the parser expects them.
  • toBinary
    Write to buffer (starting at index) the given number using a set of bytes as required by the max pos

Popular in Java

  • Finding current android device location
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • runOnUiThread (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • ImageIO (javax.imageio)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
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