Checks if there is a desired pronoun near the verb
336654
private boolean isTherePronoun(final AnalyzedTokenReadings[] tokens, int i,
      Pattern lemma, Pattern postag) {
    int j = 1;
    boolean keepCounting = true;
    while (i - j > 0 && keepCounting) {
      if (matchPostagRegexp(tokens[i - j], postag)
          && matchLemmaRegexp(tokens[i - j], lemma))
        return true;
      keepCounting = matchPostagRegexp(tokens[i - j], PREP_VERB_PRONOM);
      j++;
    }
    j = 1;
    keepCounting = true;
    while (i + j < tokens.length && keepCounting) {
      if (matchPostagRegexp(tokens[i + j], postag)
          && matchLemmaRegexp(tokens[i + j], lemma))
        return true;
      keepCounting = matchPostagRegexp(tokens[i + j], PREP_VERB_PRONOM);
      j++;
    }
    return false;
  }
1016018
function getVerbHelp(verb, output) {
    let targets = [];
    let options = {
        head: `Available resources for ${chalk.bold(verb)}:`,
        table: []
    };

    // special verbs
    let sections = [];
    switch (verb) {
    case "query":
        output.write(chalk.cyan.bold("qnamaker query --question <querytext>\n\n"));
        options.table.push([chalk.cyan.bold("--question <query>"), "query to get a prediction for"]);
        sections.push(options);
        sections.push(configSection);
        sections.push(globalArgs);
        return sections;

    case "set":
        output.write(chalk.cyan.bold("qnamaker set <.qnamakerrcSetting> <value>\n\n"));
        options.table.push([chalk.cyan.bold("kbid <kbid>"), "change the active knowledgebase id "]);
        options.table.push([chalk.cyan.bold("subscriptionkey <subscriptionkey>"), "change the active subscriptionkey"]);
        sections.push(options);
        sections.push(globalArgs);
        return sections;
    case "init":
        output.write(chalk.cyan.bold("qnamaker init\n\n"));
        sections.push(globalArgs);
        return sections;
    }

    for (let apiGroupName in manifest) {
        const category = manifest[apiGroupName];

        for (let iOperation in category.operations) {
            let operation = category.operations[iOperation];
            if (operation.methodAlias == verb) {
                let target = operation.target[0];
                if (targets.indexOf(target) < 0) {
                    targets.push(target);
                }
            }
        }
    }

    if (targets.length == 0)
        return getGeneralHelpContents(output);

    targets.sort();
    for (let verb of targets) {
        options.table.push([chalk.cyan.bold(verb), '']);
    }
    sections.push(options);
    sections.push(configSection);
    sections.push(globalArgs);
    return sections;
}
100703
def contains(self, desired):
        ''''''
        field = self.__field
        def aFilter(testDictionary):
            return (desired in testDictionary[field])
        return aFilter
347191
def lexeme(self, verb, parse=True):
        
        a = []
        b = self.lemma(verb, parse=parse)
        if b in self:
            a = [x for x in self[b] if x != ""]
        elif parse is True: # rule-based
            a = self.find_lexeme(b)
        u = []; [u.append(x) for x in a if x not in u]
        return u
1090659
def expect(self, f, *args):
        """"""
        match = self.accept(f, *args)
        if match:
            return match

        try:
            func_name = f.func_name
        except AttributeError:
            func_name = "<unnamed grammar function>"

        start, end = self.current_position()
        raise errors.EfilterParseError(
            query=self.tokenizer.source, start=start, end=end,
            message="Was expecting %s here." % (func_name))
123359
function parseRoute(route, target) {
		var verbs, routePath, routeParts;

		routeParts = route.split(' ');
		if (routeParts.length === 1) {
			verbs = ['all'];
			routePath = routeParts[0];
		} else {
			verbs = routeParts[0].split(',');
			verbs.map(function (verb) {
				return verb.trim().toLowerCase();
			});
			routePath = routeParts[1];
		}
		return {verbs: verbs, path: routePath, target: target};
	}
847875
def otherwise(first, second)
      first = first.to_s
      first.empty? ? second : first
    end
342906
def is_present(p):
    
    return lexeme(p).optional().map(lambda v: False if v is None else True)
1047819
def accept_operator(self, precedence):
        """"""
        match = grammar.infix(self.tokens)
        if not match:
            return

        if match.operator.precedence < precedence:
            return

        # The next thing is an operator that we want. Now match it for real.
        return self.tokens.accept(grammar.infix)
94264
def definite_article(word, gender=MALE, role=SUBJECT):
    
    return article_definite.get((gender[:1].lower(), role[:3].lower()))
680515
@Nullable
  private Pattern pronomPattern(AnalyzedTokenReadings aToken) {
    if (matchPostagRegexp(aToken,VERB_1S) && matchPostagRegexp(aToken,VERB_3S))
      return PRONOM_FEBLE_13S;
    if (matchPostagRegexp(aToken,VERB_2S) && matchPostagRegexp(aToken,VERB_3S))
      return PRONOM_FEBLE_23S;
    else if (matchPostagRegexp(aToken,VERB_1S) )
      return PRONOM_FEBLE_1S;
    else if (matchPostagRegexp(aToken,VERB_2S) )
      return PRONOM_FEBLE_2S;
    else if (matchPostagRegexp(aToken,VERB_3S) )
      return PRONOM_FEBLE_3S;
    else if (matchPostagRegexp(aToken,VERB_1P) )
      return PRONOM_FEBLE_1P;
    else if (matchPostagRegexp(aToken,VERB_2P) )
      return PRONOM_FEBLE_2P;
    else if (matchPostagRegexp(aToken,VERB_3P) )
      return PRONOM_FEBLE_3P;
    else
      return null;
  }
230147
function(rules, verb, group, resource) {
      var resources = rules[group];
      if (!resources) {
        return false;
      }
      var verbs = resources[resource];
      if (!verbs) {
        return false;
      }
      return _.includes(verbs, verb) || _.includes(verbs, '*');
    }
1041125
function next_tag_is(sentence, i, parameter) {
  if (i < sentence.taggedWords.length - 1) {
    return(sentence.taggedWords[i + 1].tag === parameter);
  }
  else {
    return(false);
  }
}
100055
def _verbs_with_subjects(doc):
    """"""
    # TODO: UNUSED
    verb_subj = []
    for possible_subject in doc:
        if (possible_subject.dep_ == 'nsubj' and possible_subject.head.pos_ ==
                'VERB'):
            verb_subj.append([possible_subject.head, possible_subject])
    return verb_subj
787903
def _matchremove_verb_endings(self, word):
        """"""

        i_verb_endings = ['iuntur',
                            'erunt',
                            'untur',
                            'iunt',
                            'unt']

        bi_verb_endings = ['beris',
                            'bor',
                            'bo']

        eri_verb_endings = ['ero']

        verb_endings = ['mini',
                            'ntur',
                            'stis',
                            'mur',
                            'mus',
                            'ris',
                            'sti',
                            'tis',
                            'tur',
                            'ns',
                            'nt',
                            'ri',
                            'm',
                            'r',
                            's',
                            't']

        # replace i verb endings with i
        for ending in i_verb_endings:
            if word.endswith(ending):
                word = re.sub(r'{0}$'.format(ending), 'i', word)
                return word

        # replace bi verb endings with bi
        for ending in bi_verb_endings:
            if word.endswith(ending):
                word = re.sub(r'{0}$'.format(ending), 'bi', word)
                return word

        # replace eri verb endings with eri
        for ending in eri_verb_endings:
            if word.endswith(ending):
                word = re.sub(r'{0}$'.format(ending), 'eri', word)
                return word

        # otherwise, remove general verb endings
        for ending in verb_endings:
            if word.endswith(ending):
                word = re.sub(r'{0}$'.format(ending), '', word)
                break

        return word
171405
public void checkNoModifiers(String noun, String verb) throws FHIRException {
        if (hasModifierExtension()) {
          throw new FHIRException("Found unknown Modifier Exceptions on "+noun+" doing "+verb);
        }
        
  }
544602
def check_sentence():
    """"""
    text = ''
    if request.method == 'POST':
        text = request.form['text']
        if not text:
            error = 'No input'
            flash_message = error
        else:
            fb = check(request.form['text'])
            correct = False
            if request.form.get('is_correct') and not fb.primary_error:
                correct = True
            elif not request.form.get('is_correct') and fb.primary_error:
                correct = True
            sub = Submission(text=text, correct=correct, primary_error=fb.primary_error,
                    specific_error=fb.specific_error)
            session.add(sub)
            session.commit()
            # TODO: remove the hack below
            if not fb.primary_error:
                fb.human_readable = "No errors were found."
            flash_message = fb.human_readable

        flash(flash_message)
    return render_template('check_sentence.html', text=text)