• Jump To … +
    abbreviations.js adjectives.js convertables.js dates.js demonyms.js firstnames.js honourifics.js irregular_nouns.js irregular_verbs.js misc.js multiples.js numbers.js organisations.js phrasal_verbs.js places.js uncountables.js verbs.js fns.js index.js lexicon.js negate.js passive_voice.js contractions.js fancy_lumping.js grammar_rules.js parts_of_speech.js phrasal_verbs.js tagger.js word_rules.js question.js sentence.js statement.js tense.js adjective.js to_adverb.js to_comparative.js to_noun.js to_superlative.js adverb.js to_adjective.js is_acronym.js article.js date.js date_rules.js is_date.js parse_date.js is_plural.js is_uncountable.js noun.js is_organisation.js organisation.js gender.js is_person.js parse_name.js person.js is_place.js place.js pluralize.js pronoun.js singularize.js is_value.js numbers.js to_number.js units.js value.js term.js conjugate.js from_infinitive.js predict_form.js suffix_rules.js to_actor.js to_infinitive.js negate.js verb.js sentence_parser.js text.js
  • noun.js

  • ¶
    'use strict';
    const Term = require('../term.js');
    const article = require('./article.js');
    const is_plural = require('./is_plural.js');
    const is_place = require('./place/is_place.js');
    const is_person = require('./person/is_person.js');
    const pronoun = require('./pronoun.js');
    const is_value = require('./value/is_value.js');
    const is_date = require('./date/is_date.js');
    const is_organisation = require('./organisation/is_organisation.js');
    const singularize = require('./singularize.js');
    const pluralize = require('./pluralize.js');
    const is_uncountable = require('./is_uncountable.js');
    
    class Noun extends Term {
      constructor(str, tag) {
        super(str);
        this.tag = tag;
        this.pos['Noun'] = true;
        if (tag) {
          this.pos[tag] = true;
        }
      }
  • ¶

    noun methods

      article() {
        return article(this.text);
      }
      pronoun() {
        if (this.is_organisation() || this.is_place() || this.is_value()) {
          return 'it';
        }
        return pronoun(this.normal);
      }
      is_plural() {
        return is_plural(this.normal);
      }
      is_uncountable() {
        return is_uncountable(this.normal);
      }
      pluralize() {
        return pluralize(this.normal);
      }
      singularize() {
        return singularize(this.normal);
      }
  • ¶

    sub-classes

      is_person() {
        return is_person(this.normal);
      }
      is_organisation() {
        return is_organisation(this.normal, this.text);
      }
      is_date() {
        return is_date(this.normal);
      }
      is_value() {
        return is_value(this.normal);
      }
      is_place() {
        return is_place(this.normal);
      }
    
    }
    
    Noun.fn = Noun.prototype;
    
    module.exports = Noun;
  • ¶

    let t = new Noun(‘NDA’); console.log(t.article());