Detects names for provided array of tokens

 @param [Array<String>] tokens tokens to run name detection on
 @return [Array<Java::opennlp.tools.util.Span>] names detected
514143
def detect(tokens)
      raise ArgumentError, 'tokens must be an instance of Array' unless tokens.is_a?(Array)

      j_instance.find(tokens.to_java(:String)).to_ary
    end
306132
public final List<Morpheme> getMorphemes(final String[] tokens) {
    final List<String> origPosTags = posAnnotate(tokens);
    final List<Morpheme> morphemes = getMorphemesFromStrings(origPosTags,
        tokens);
    return morphemes;
  }
1229171
private static List<Tokenizer.Token> toReversePolishNotation(List<Tokenizer.Token> tokens) {
        LinkedList<Tokenizer.Token> queue = new LinkedList<Tokenizer.Token>();
        Stack<Tokenizer.Token> stack = new Stack<Tokenizer.Token>();

        for (int i = 0; i < tokens.size(); i++) {
            Tokenizer.Token token = tokens.get(i);
            switch (token.type) {
                case VERSION:
                    queue.add(token);
                    break;
                case CLOSING:
                    while (stack.peek().type != Tokenizer.TokenType.OPENING) {
                        queue.add(stack.pop());
                    }
                    stack.pop();
                    if (stack.size() > 0 && stack.peek().type.isUnary()) {
                        queue.add(stack.pop());
                    }
                    break;
                default:
                    if (token.type.isUnary()) {
                        queue.push(token);
                        i++;
                        queue.push(tokens.get(i));
                    } else {
                        stack.push(token);
                    }
                    break;
            }
        }

        while (!stack.isEmpty()) {
            queue.add(stack.pop());
        }

        Collections.reverse(queue);
        return queue;
    }
146852
protected Name parseNodeTypeName( TokenStream tokens ) {
        tokens.consume('[');
        Name name = parseName(tokens);
        tokens.consume(']');
        return name;
    }
163482
public static List<String> wonderfulTokenizer(String tokenString, String[] delimiters) {
		List<String> tokens = new ArrayList<String>();
		String currentToken = "";
		for(int i = 0; i < tokenString.length(); i++) {
			String _currItem = String.valueOf(tokenString.charAt(i));
			if(_currItem.trim().isEmpty()) continue;

			String delimiterFound = "";
			for(String d: delimiters) {
				if(d.startsWith(_currItem)) {
					if(d.length() > 1) {
						if(d.equals(tokenString.substring(i, i + d.length()))) {
							delimiterFound = d;
							i = i + (d.length() - 1);
						}
					} else delimiterFound = d;
				}
				if(!delimiterFound.isEmpty()) break;
			}

			if(!delimiterFound.isEmpty()) {
				if(!currentToken.isEmpty()) {
					tokens.add(currentToken);
					currentToken = "";
				}
				tokens.add(delimiterFound);
			} else currentToken += _currItem;
		}
		if(!currentToken.isEmpty()) tokens.add(currentToken);

		return tokens;
	}
323913
private String getSentenceFromTokens(final String[] tokens) {
    final StringBuilder sb = new StringBuilder();
    for (final String token : tokens) {
      sb.append(token).append(" ");
    }
    final String sentence = sb.toString();
    return sentence;
  }
1098395
public List<String> getBilouDictionaryMatch(final String[] tokens) {

    final List<String> entitiesList = new ArrayList<String>();

    String prefix = "-" + BilouCodec.START;
    String gazClass = null;
    String searchSpan = null;
    // iterative over tokens from the beginning
    for (int i = 0; i < tokens.length; i++) {
      gazClass = null;
      int j;
      // iterate over tokens from the end
      for (j = tokens.length - 1; j >= i; j--) {
        // create span for search in dictionary Map; the first search takes as
        // span
        // the whole sentence
        searchSpan = createSpan(tokens, i, j);
        gazClass = lookup(searchSpan.toLowerCase());
        if (gazClass != null) {
          break;
        }
      }
      prefix = "-" + BilouCodec.START;
      // multi-token case
      if (gazClass != null) {
        while (i < j) {
          entitiesList.add((gazClass + prefix).intern());
          prefix = "-" + BilouCodec.CONTINUE;
          i++;
        }
      }
      // one word case or last member of span
      if (gazClass != null) {
        if (prefix.equals("-" + BilouCodec.START)) {
          entitiesList.add((gazClass + "-" + BilouCodec.UNIT).intern());
        } else if (prefix.equals("-" + BilouCodec.CONTINUE)) {
          entitiesList.add((gazClass + "-" + BilouCodec.LAST).intern());
        }
      } else {
        entitiesList.add(BilouCodec.OTHER);
      }
    }
    return entitiesList;
  }
431793
def tag_list=(names)
      self.tags = names.split(",").map do |n|
        SimpleTags::Tag.where(name: n.strip).first_or_create!
      end
    end
181839
def parse_name(lexer: Lexer) -> NameNode:
    """"""
    token = expect_token(lexer, TokenKind.NAME)
    return NameNode(value=token.value, loc=loc(lexer, token))
1180175
def tags(instance)
      return [] if instance.groupSet.nil? || instance.groupSet.item.empty?
      instance.groupSet.item.collect{|g| g.groupId }.select {|s| s.start_with? "#poolparty"}
    end
752756
def get_identifiers(self):
        
        for token in self.tokens:
            if not (token.is_whitespace or token.match(T.Punctuation, ',')):
                yield token
645520
function handleToken(tokens, name) {
		var value = tokens[name];

		var type = Prism.util.type(value);
		switch (type) {
			case 'RegExp':
				var inside = {};
				tokens[name] = {
					pattern: value,
					inside: inside
				};
				addInvisibles(inside);
				break;

			case 'Array':
				for (var i = 0, l = value.length; i < l; i++) {
					handleToken(value, i);
				}
				break;

			default: // 'Object'
				var inside = value.inside || (value.inside = {});
				addInvisibles(inside);
				break;
		}
	}
406609
def tokens
      options.collection.each do |option|
        if @findings.nil?
          @findings = option.tokenize(self)
        else
          @findings &= option.tokenize(self)
        end
      end

      Tokenizer.new(self).tokens
    end
60439
public final Span[] seqToSpans(final String[] tokens) {
    final Span[] annotatedText = this.sequenceLabeler.tag(tokens);
    final List<Span> probSpans = new ArrayList<Span>(
        Arrays.asList(annotatedText));
    return probSpans.toArray(new Span[probSpans.size()]);
  }
1140000
def replace_tokens(string)
      data = string.dup
      @tokens.each do |name, val|
        data.gsub!(/\:#{name}/, val.to_s)
      end
      data
    end
1321603
boolean compareLists(AnalyzedTokenReadings[] tokens, int startIndex, int endIndex, Pattern[] patterns) {
    if (startIndex < 0) {
      return false;
    }
    int i = 0;
    for (int j = startIndex; j <= endIndex; j++) {
      if (i >= patterns.length || j >= tokens.length || !patterns[i].matcher(tokens[j].getToken()).matches()) {
        return false;
      }
      i++;
    }
    return true;
  }
443626
def names(self, with_namespace=False):
        '''
        '''
        N = self.count()
        names = self.name.split(settings.splittingnames)[:N]
        n = 0
        while len(names) < N:
            n += 1
            names.append('unnamed%s' % n)
        if with_namespace and self.namespace:
            n = self.namespace
            s = settings.field_separator
            return [n + s + f for f in names]
        else:
            return names