|
|
|
@@ -60,6 +60,10 @@ enum VowelSound { |
|
|
|
NonVowel |
|
|
|
} |
|
|
|
|
|
|
|
export interface Pluralizable { |
|
|
|
isPlural: boolean; |
|
|
|
} |
|
|
|
|
|
|
|
interface WordOptions { |
|
|
|
plural: boolean; |
|
|
|
capital: boolean; |
|
|
|
@@ -92,7 +96,7 @@ export class DynText { |
|
|
|
return (this.parts.map(part => part.toString())).join('') |
|
|
|
} |
|
|
|
} |
|
|
|
export class Noun { |
|
|
|
export class Noun implements Pluralizable { |
|
|
|
constructor (private singularNoun: string, private pluralNoun: string|null = null, private options: WordOptions = { plural: false, capital: false, proper: false, kind: NounKind.Specific, vowel: VowelSound.Default, count: true }) { |
|
|
|
|
|
|
|
} |
|
|
|
@@ -145,6 +149,10 @@ export class Noun { |
|
|
|
return new Noun(this.singularNoun, this.pluralNoun, opts) |
|
|
|
} |
|
|
|
|
|
|
|
get isPlural (): boolean { |
|
|
|
return this.options.plural |
|
|
|
} |
|
|
|
|
|
|
|
toString (): string { |
|
|
|
let result: string |
|
|
|
|
|
|
|
@@ -207,8 +215,8 @@ interface PronounDict { |
|
|
|
reflexive: string; |
|
|
|
} |
|
|
|
|
|
|
|
export class Pronoun { |
|
|
|
constructor (private pronouns: PronounDict, private capitalize: boolean = false) { |
|
|
|
export class Pronoun implements Pluralizable { |
|
|
|
constructor (private pronouns: PronounDict, private capitalize: boolean = false, public isPlural: boolean = false) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@@ -260,14 +268,14 @@ export const TheyPronouns = new Pronoun({ |
|
|
|
objective: 'them', |
|
|
|
possessive: 'their', |
|
|
|
reflexive: 'themself' |
|
|
|
}) |
|
|
|
}, false, true) |
|
|
|
|
|
|
|
export const TheyPluralPronouns = new Pronoun({ |
|
|
|
subjective: 'they', |
|
|
|
objective: 'them', |
|
|
|
possessive: 'their', |
|
|
|
reflexive: 'themselves' |
|
|
|
}) |
|
|
|
}, false, true) |
|
|
|
|
|
|
|
export const ObjectPronouns = new Pronoun({ |
|
|
|
subjective: 'it', |
|
|
|
|