Examples of StringList


Examples of opennlp.tools.util.StringList

      String text = nameAnnotation.getCoveredText();

      // if possible replace text with normalization from dictionary
      if (mLookupDictionary != null) {

        StringList tokens = new StringList(text);

        String normalizedText = mLookupDictionary.get(tokens);

        if (normalizedText != null) {
          text = normalizedText;
View Full Code Here

Examples of opennlp.tools.util.StringList

   * @throws IOException
   */
  public static Dictionary createDictionary(ObjectStream<StringList> sampleStream) throws IOException {

    Dictionary mNameDictionary = new Dictionary(true);
    StringList entry;

    entry = sampleStream.read();
    while (entry != null) {
      if (!mNameDictionary.contains(entry)) {
        mNameDictionary.put(entry);
View Full Code Here

Examples of opennlp.tools.util.StringList

      //add all uni-grams
      for (int wi=0;wi<words.length;wi++) {
        words[wi] = pwords[wi].toString();
      }

      mdict.add(new StringList(words), 1, 1);
      //add tri-grams and bi-grams for inital sequence
      Parse[] chunks = collapsePunctuation(ParserEventStream.getInitialChunks(p),rules.getPunctuationTags());
      String[] cwords = new String[chunks.length];
      for (int wi=0;wi<cwords.length;wi++) {
        cwords[wi] = chunks[wi].getHead().toString();
      }
      mdict.add(new StringList(cwords), 2, 3);

      //emulate reductions to produce additional n-grams
      int ci = 0;
      while (ci < chunks.length) {
        //System.err.println("chunks["+ci+"]="+chunks[ci].getHead().toString()+" chunks.length="+chunks.length);
        if (lastChild(chunks[ci], chunks[ci].getParent(),rules.getPunctuationTags())) {
          //perform reduce
          int reduceStart = ci;
          while (reduceStart >=0 && chunks[reduceStart].getParent() == chunks[ci].getParent()) {
            reduceStart--;
          }
          reduceStart++;
          chunks = ParserEventStream.reduceChunks(chunks,ci,chunks[ci].getParent());
          ci = reduceStart;
          if (chunks.length != 0) {
            String[] window = new String[5];
            int wi = 0;
            if (ci-2 >= 0) window[wi++] = chunks[ci-2].getHead().toString();
            if (ci-1 >= 0) window[wi++] = chunks[ci-1].getHead().toString();
            window[wi++] = chunks[ci].getHead().toString();
            if (ci+1 < chunks.length) window[wi++] = chunks[ci+1].getHead().toString();
            if (ci+2 < chunks.length) window[wi++] = chunks[ci+2].getHead().toString();
            if (wi < 5) {
              String[] subWindow = new String[wi];
              for (int swi=0;swi<wi;swi++) {
                subWindow[swi]=window[swi];
              }
              window = subWindow;
            }
            if (window.length >=3) {
              mdict.add(new StringList(window), 2, 3);
            }
            else if (window.length == 2) {
              mdict.add(new StringList(window), 2, 2);
            }
          }
          ci=reduceStart-1; //ci will be incremented at end of loop
        }
        ci++;
View Full Code Here

Examples of opennlp.tools.util.StringList

        return mDictionaryIterator.hasNext();
      }

      public Entry next() {

        StringList tokens = mDictionaryIterator.next();

        Attributes attributes = new Attributes();

        attributes.setValue("value", get(tokens));
View Full Code Here

Examples of org.apache.archiva.rest.api.model.StringList

    @Override
    public StringList getObservablesRepoIds()
        throws ArchivaRestServiceException
    {
        return new StringList( getObservableRepos() );
    }
View Full Code Here

Examples of org.apache.uima.jcas.cas.StringList

    return asList(data.toArray(new TOP[data.size()]));
  }

  public static Collection<String> create(StringList aList) {
    List<String> data = new ArrayList<String>();
    StringList i = aList;
    while (i instanceof NonEmptyStringList) {
      NonEmptyStringList l = (NonEmptyStringList) i;
      data.add(l.getHead());
      i = l.getTail();
    }
View Full Code Here

Examples of org.apache.wicket.util.string.StringList

    final MetaPattern valuePattern)
  {
    super();

    // Get list of strings separated by the delimiter
    final StringList pairs = StringList.tokenize(keyValuePairs, delimiter);

    // Go through each string in the list
    for (IStringIterator iterator = pairs.iterator(); iterator.hasNext();)
    {
      // Get the next key value pair
      final String pair = iterator.next();

      // Parse using metapattern parser for variable assignments
View Full Code Here

Examples of org.apache.wicket.util.string.StringList

    // attributes, rather than URL parameters. URL param keys for
    // examples are allowed to start with a digit (e.g. 0=xxx)
    // and quotes are not "quotes".

    // Get list of strings separated by the delimiter
    final StringList pairs = StringList.tokenize(keyValuePairs, delimiter);

    // Go through each string in the list
    for (IStringIterator iterator = pairs.iterator(); iterator.hasNext();)
    {
      // Get the next key value pair
      final String pair = iterator.next();

      final int pos = pair.indexOf('=');
View Full Code Here

Examples of org.apache.wicket.util.string.StringList

    // attributes, rather than URL parameters. URL param keys for
    // examples are allowed to start with a digit (e.g. 0=xxx)
    // and quotes are not "quotes".

    // Get list of strings separated by the delimiter
    final StringList pairs = StringList.tokenize(keyValuePairs, delimiter);

    // Go through each string in the list
    for (IStringIterator iterator = pairs.iterator(); iterator.hasNext();)
    {
      // Get the next key value pair
      final String pair = iterator.next();

      final int pos = pair.indexOf('=');
View Full Code Here

Examples of org.apache.wicket.util.string.StringList

    final MetaPattern valuePattern)
  {
    super();

    // Get list of strings separated by the delimiter
    final StringList pairs = StringList.tokenize(keyValuePairs, delimiter);

    // Go through each string in the list
    for (IStringIterator iterator = pairs.iterator(); iterator.hasNext();)
    {
      // Get the next key value pair
      final String pair = iterator.next();

      // Parse using metapattern parser for variable assignments
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.