Parses the production rule::
                value : TERM (',' TERM)*

            Returns list of string terms.
546245
def _rule_value(self):
        

        terms = [self._get_token()]

        # consume additional terms if available
        while self._lookahead_token() == ',':
            self._get_token()  # chomp the comma
            terms.append(self._get_token())

        return terms
43955
def _or_join(self, terms):
        

        if isinstance(terms, (tuple, list)):
            if len(terms) > 1:
                return '(' + ' OR '.join(terms) + ')'
            else:
                return terms[0]
        else:
            return terms
1087648
def parse(query)
      @symbols = Tokenizer.symbols(query)
      @position = 0
      r = []
      r << read_maximal_term(0) until empty?
      r
    end
801516
def string(self):
        
        for term in self._terms:
            if isinstance(term, String):
                return str(term)
        return None
403828
def _formatOntologyTerm(self, element, element_type):
        
        elementClause = None
        if isinstance(element, dict) and element.get('terms'):
            elements = []
            for _term in element['terms']:
                if _term.get('id'):
                    elements.append('?{} = <{}> '.format(
                        element_type, _term['id']))
                else:
                    elements.append('?{} = <{}> '.format(
                        element_type, self._toNamespaceURL(_term['term'])))
            elementClause = "({})".format(" || ".join(elements))
        return elementClause
841151
def _term_str(term: TermAtom) -> str:  # pragma: no cover
    """"""
    if is_operation(term):
        return term.name + '('
    elif is_symbol_wildcard(term):
        return '*{!s}'.format(term.__name__)
    elif isinstance(term, Wildcard):
        return '*{!s}{!s}'.format(term.min_count, (not term.fixed_size) and '+' or '')
    elif term == Wildcard:
        return '*'
    else:
        return str(term)
801311
def all_terms(self):
        """"""

        for s_name, s in self.sections.items():

            # Yield the section header
            if s.name != 'Root':
                yield s

            # Yield all of the rows for terms in the section
            for rterm in s:
                yield rterm
                for d in rterm.descendents:
                    yield d
334859
def parse_simple_args(self, term):
        """"""
        match = SHORTCUT.match(term)
        if not match:
            return False

        _, start, end, _, stride, _, format = match.groups()

        if start is not None:
            try:
                start = int(start, 0)
            except ValueError:
                raise AnsibleError("can't parse start=%s as integer" % start)
        if end is not None:
            try:
                end = int(end, 0)
            except ValueError:
                raise AnsibleError("can't parse end=%s as integer" % end)
        if stride is not None:
            try:
                stride = int(stride, 0)
            except ValueError:
                raise AnsibleError("can't parse stride=%s as integer" % stride)

        if start is not None:
            self.start = start
        if end is not None:
            self.end = end
        if stride is not None:
            self.stride = stride
        if format is not None:
            self.format = format
372005
private static function generateFuzzyTerms(string $term): array
    {
        $terms = [$term . '_'];
        for ($i = 0; $i < strlen($term); ++$i) {
            // insertions
            $terms[] = substr($term, 0, $i) . '_' . substr($term, $i);
            // deletions
            $terms[] = substr($term, 0, $i) . substr($term, $i + 1);
            // substitutions
            $terms[] = substr($term, 0, $i) . '_' . substr($term, $i + 1);
        }

        return $terms;
    }
97711
def search_terms(q):
    ''''''
    tokens = parse_search_terms(q)
    # iterate through all the tokens and make a list of token values
    # (which are the actual words and phrases)
    values = []
    for t in tokens:
        # word/phrase
        if t[0] is None:
            values.append(t[1])
        # incomplete field
        elif t[1] is None:
            values.append('%s:' % t[0])
        # anything else must be a field, value pair
        # - if value includes whitespace, wrap in quotes
        elif re.search('\s', t[1]):
            values.append('%s:"%s"' % t)
        # otherwise, leave unquoted
        else:
            values.append('%s:%s' % t)
    return values
620936
def prepareQueryTerm(self, field, term):
        
        if term == "*":
            return term
        addstar = False
        if term[len(term) - 1] == '*':
            addstar = True
            term = term[0 : len(term) - 1]
        term = self.escapeQueryTerm(term)
        if addstar:
            term = '%s*' % term
        if self.getSolrType(field) in ['string', 'text', 'text_ws']:
            return '"%s"' % term
        return term
1235331
def setTerms( self, terms ):
        
        return self.setRules([XQueryRule(term = term) for term in terms])
873348
public static String termValue(String term) {
    int i = term.indexOf(MtasToken.DELIMITER);
    String value = null;
    if (i >= 0) {
      value = term.substring((i + MtasToken.DELIMITER.length()));
      value = (value.length() > 0) ? value : null;
    }
    return (value == null) ? null : value.replace("\u0000", "");
  }
375720
def parseSearchTerm(term):
    
    terms = []
    keywords = {}
    for word in term.split():
        if word.count(':') == 1:
            k, v = word.split(u':')
            if k and v:
                keywords[k] = v
            elif k or v:
                terms.append(k or v)
        else:
            terms.append(word)
    term = u' '.join(terms)
    if keywords:
        return term, keywords
    return term, None
1091877
def _term(g):
    """"""
    all_t = {x for rule in g.rules for x in rule.rhs if isinstance(x, T)}
    t_rules = {t: Rule(NT('__T_%s' % str(t)), [t], weight=0, alias='Term') for t in all_t}
    new_rules = []
    for rule in g.rules:
        if len(rule.rhs) > 1 and any(isinstance(x, T) for x in rule.rhs):
            new_rhs = [t_rules[x].lhs if isinstance(x, T) else x for x in rule.rhs]
            new_rules.append(Rule(rule.lhs, new_rhs, weight=rule.weight, alias=rule.alias))
            new_rules.extend(v for k, v in t_rules.items() if k in rule.rhs)
        else:
            new_rules.append(rule)
    return Grammar(new_rules)
139636
def get_all_chunks_for_term(self,termid):
        
        terminal_id = self.terminal_for_term.get(termid)
        paths = self.paths_for_terminal[terminal_id]
        for path in paths:
            for node in path:
                this_type = self.label_for_nonter[node]
                subsumed =  self.terms_subsumed_by_nonter.get(node)
                if subsumed is not None:
                    yield this_type,sorted(list(subsumed))
197286
def p_term_list(self, p):
        ''''''
        if p[1] is None:
            p[0] = []
        elif len(p) == 4:
            p[1].append(p[3])
            p[0] = p[1]
        elif len(p) == 2:
            p[0] = [p[1]]