Tabnine Logo
JPhonemiser.lexiconLookupPrimitive
Code IndexAdd Tabnine to your IDE (free)

How to use
lexiconLookupPrimitive
method
in
marytts.modules.JPhonemiser

Best Java code snippets using marytts.modules.JPhonemiser.lexiconLookupPrimitive (Showing top 3 results out of 315)

origin: marytts/marytts

/**
 * Look a given text up in the (standard) lexicon. part-of-speech is used in case of ambiguity.
 *
 * @param text
 *            text
 * @param pos
 *            pos
 * @return null if text == null or text.length is 0, null if entries.length is 0, entries[0] otherwise
 */
public String lexiconLookup(String text, String pos) {
  if (text == null || text.length() == 0)
    return null;
  String[] entries;
  entries = lexiconLookupPrimitive(text, pos);
  // If entry is not found directly, try the following changes:
  // - lowercase the word
  // - all lowercase but first uppercase
  if (entries.length == 0) {
    text = text.toLowerCase(getLocale());
    entries = lexiconLookupPrimitive(text, pos);
  }
  if (entries.length == 0) {
    text = text.substring(0, 1).toUpperCase(getLocale()) + text.substring(1);
    entries = lexiconLookupPrimitive(text, pos);
  }
  if (entries.length == 0)
    return null;
  return entries[0];
}
origin: marytts/marytts

/**
 * Look a given text up in the (standard) lexicon. part-of-speech is used in case of ambiguity.
 *
 * @param text
 *            text
 * @param pos
 *            pos
 * @return null if text == null or text.length is 0, null if entries.length is 0, entries[0] otherwise
 */
public String lexiconLookup(String text, String pos) {
  if (text == null || text.length() == 0)
    return null;
  String[] entries;
  entries = lexiconLookupPrimitive(text, pos);
  // If entry is not found directly, try the following changes:
  // - lowercase the word
  // - all lowercase but first uppercase
  if (entries.length == 0) {
    text = text.toLowerCase(getLocale());
    entries = lexiconLookupPrimitive(text, pos);
  }
  if (entries.length == 0) {
    text = text.substring(0, 1).toUpperCase(getLocale()) + text.substring(1);
    entries = lexiconLookupPrimitive(text, pos);
  }
  if (entries.length == 0)
    return null;
  return entries[0];
}
origin: de.dfki.mary/marytts-runtime

/**
 * Look a given text up in the (standard) lexicon. part-of-speech is used in case of ambiguity.
 *
 * @param text
 *            text
 * @param pos
 *            pos
 * @return null if text == null or text.length is 0, null if entries.length is 0, entries[0] otherwise
 */
public String lexiconLookup(String text, String pos) {
  if (text == null || text.length() == 0)
    return null;
  String[] entries;
  entries = lexiconLookupPrimitive(text, pos);
  // If entry is not found directly, try the following changes:
  // - lowercase the word
  // - all lowercase but first uppercase
  if (entries.length == 0) {
    text = text.toLowerCase(getLocale());
    entries = lexiconLookupPrimitive(text, pos);
  }
  if (entries.length == 0) {
    text = text.substring(0, 1).toUpperCase(getLocale()) + text.substring(1);
    entries = lexiconLookupPrimitive(text, pos);
  }
  if (entries.length == 0)
    return null;
  return entries[0];
}
marytts.modulesJPhonemiserlexiconLookupPrimitive

Popular methods of JPhonemiser

  • getLocale
  • isPosPunctuation
    Based on the regex compiled in #setPunctuationPosRegex(), determine whether a given POS string is cl
  • isUnpronounceable
  • lexiconLookup
    Look a given text up in the (standard) lexicon. part-of-speech is used in case of ambiguity.
  • maybePronounceable
    Determine whether token should be pronounceable, based on text and POS tag.
  • outputType
  • phonemise
    Phonemise the word text. This starts with a simple lexicon lookup, followed by some heuristics, and
  • readLexicon
    Read a lexicon. Lines must have the format graphemestring | phonestring | optional-parts-of-speech T
  • setPh
  • setPunctuationPosRegex
    Compile a regex pattern used to determine whether tokens are processed as punctuation or not, based
  • setUnpronounceablePosRegex
    Compile a regex pattern used to determine whether tokens are processed as unprounounceable or not, b
  • startup
  • setUnpronounceablePosRegex,
  • startup,
  • userdictLookup

Popular in Java

  • Reactive rest calls using spring rest template
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (Timer)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now