Given a correct sentence, return a sentence or sentences with a subject
    verb agreement error
965719
def mangle_agreement(correct_sentence):
    """"""
    # # Examples
    #
    # Back in the 1800s, people were much shorter and much stronger.
    # This sentence begins with the introductory phrase, 'back in the 1800s'
    # which means that it should have the past tense verb. Any other verb would
    # be incorrect. 
    #
    #
    # Jack and jill went up the hill. 
    # This sentence is different; 'go' would also be correct. If it began with
    # 'Yesterday', a single-word introductory phrase requiring no comma, only
    # 'went' would be acceptable.
    #
    #  
    # The man in the checkered shirt danced his warrior dance to show that
    # he was the most dominant male in the room.
    # This sentence has multiple verbs. If the sentence ended at the word dance,
    # changing 'danced' to 'dances' would be acceptable, but since the sentence
    # continues we cannot make this change -- 'was' agrees with 'danced' but not
    # with 'dances'.  This is a shifty tense error, a classic subject verb
    # agreement error.
    # 
    # # Our Method
    # 
    # Right now, we will assume that any change in verb form of a single verb in
    # a sentence is incorrect.  As demonstrated above, this is not always true.
    # We hope that since any model created off of this data will use a
    # confidence interval to determine likelihood of a subject-verb agreement
    # error, that some number can be found for which the model excels.
    # 
    # It would also be possible to use a rule based learner to evaluate single
    # verb sentences, and only evaluating more complex sentences with the
    # tensorflow model.

    bad_sents = []
    doc = nlp(correct_sentence)
    verbs = [(i, v) for (i, v) in enumerate(doc) if v.tag_.startswith('VB')]
    for i, v in verbs:
        for alt_verb in lexeme(doc[i].text):
            if alt_verb == doc[i].text:
                continue # Same as the original, skip it
            if (tenses(alt_verb) == tenses(v.text) or
                    (alt_verb.startswith(v.text) and alt_verb.endswith("n't"))):
                continue # Negated version of the original, skip it
            new_sent = str(doc[:i]) + " {} ".format(alt_verb) + str(doc[i+1:]) 
            new_sent = new_sent.replace(' ,', ',') # fix space before comma
            bad_sents.append(new_sent)
    return bad_sents
505731
def syntax_err(self):
        """"""
        args = self.args[:2] + (None, None) + self.args[4:]
        err = SyntaxError(self.message(*args))
        err.offset = args[2]
        err.lineno = args[3]
        return err
1137079
function grammarSyntaxError(matchFailure) {
  var e = new Error();
  Object.defineProperty(e, 'message', {get: function() { return matchFailure.message; }});
  Object.defineProperty(e, 'shortMessage', {get: function() {
    return 'Expected ' + matchFailure.getExpectedText();
  }});
  e.interval = matchFailure.getInterval();
  return e;
}
1036423
def make_sentence(sentence, *args, **kwargs):
    
    return symbols.SENTENCE(*([sentence] + list(args)), **kwargs)
678462
function createErrorHandler(verb) {
            return function(err) {
                if (!callback) { return; }
                grunt.verbose.error();
                grunt.fail.warn("Failed to " + verb + ": " + err.message);
                callbackOnce(err);
            };
        }
514067
def message(self, to, subject, text):
        """"""
        return self.compose(to, subject, text)
231614
def get_objects(self, subject, predicate):
        
        for statement in self.spo_search(subject=subject, predicate=predicate):
            yield str(statement[2])
921595
def get_subjects(self, predicate, object):
        
        for statement in self.spo_search(predicate=predicate, object=object):
            yield str(statement[0])
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)
576361
def get_subject(self, text):
        
        first_line = text.splitlines(True)[0]
        # TODO second line should be empty
        if first_line.startswith('SUBJECT:'):
            subject = first_line[len('SUBJECT:'):]
        else:
            subject = first_line
        return subject.strip()
518380
def encode_sentence(sentence):
    """"""
    tree = etree.Element('sentence')
    encode_infons(tree, sentence.infons)
    etree.SubElement(tree, 'offset').text = str(sentence.offset)
    if sentence.text:
        etree.SubElement(tree, 'text').text = sentence.text
    for ann in sentence.annotations:
        tree.append(encode_annotation(ann))
    for rel in sentence.relations:
        tree.append(encode_relation(rel))
    return tree
711988
def correct(self):
    
    # regex matches: contraction or word or punctuation or whitespace
    tokens = nltk.tokenize.regexp_tokenize(self.raw, "\w*('\w*)+|\w+|[^\w\s]|\s")
    corrected = (Word(w).correct() for w in tokens)
    ret = ''.join(corrected)
    return self.__class__(ret)
1027972
function makeError(code, text) {
  var err = new Error(text);
  err.code = code;
  return err;
}
827316
def search(pattern, sentence, *args, **kwargs):
    
    return compile(pattern, *args, **kwargs).search(sentence)
298278
def tokenize(self, sentence,
                 normalize=True,
                 is_feature=False,
                 is_surface=False,
                 return_list=False,
                 func_normalizer=text_preprocess.normalize_text):
        # type: (text_type, bool, bool, bool, bool, Callable[[text_type], text_type]) -> Union[TokenizedSenetence, List[text_type]]
        
        if normalize:
            normalized_sentence = func_normalizer(sentence)
        else:
            normalized_sentence = sentence

        ml_token_object = self.call_juman_interface(normalized_sentence)

        token_objects = [
            juman_utils.extract_morphological_information(
                mrph_object=morph_object,
                is_surface=is_surface,
                is_feature=is_feature
            )
            for morph_object in ml_token_object]

        if return_list:
            tokenized_objects = TokenizedSenetence(
                sentence=sentence,
                tokenized_objects=token_objects)
            return tokenized_objects.convert_list_object()
        else:
            tokenized_objects = TokenizedSenetence(
                sentence=sentence,
                tokenized_objects=token_objects)
            return tokenized_objects
963268
def p_system_sentence(self, t):
        """"""

        if len(t) == 3:
            t[0] = system(t[2], reference=True, line=t.lineno(1))
        else:
            t[0] = system(t[2], t[4], line=t.lineno(1))
1263787
function TypeError (msg, spec, value) {
  const e = Error(msg)
  return Object.assign(e, { spec, value })
}