matthewkeil / vue-flash-cards

vue3 flash-card app
0 stars 0 forks source link

Fix Simple Past Tense Conjugation to Double Last Letter Correctly #1

Open matthewkeil opened 2 years ago

matthewkeil commented 2 years ago

See this page for explanation of the rules for doubling the last letter: https://www.grammar-monster.com/glossary/simple_past_tense.htm

Rules for doubling last letter: 1) If last syllable of a longer verb is stressed and ends [consonant-vowel-consonant], double the last consonant and add "ed": incur > incurred prefer > preferred

2) If the first syllable of a longer verb is stressed and the verb ends [consonant-vowel-consonant], just add "ed": open > opened enter > entered swallow > swallowed

There are several lists of verbs that I found online and we can massage them into a map that we can use for lookup to figure out where the stress is. We will need to build the map/object though and with such long lists it will be easier to do it programmatically.

See this page for information on the lists sorted by stress: http://www.ashley-bovan.co.uk/words/feet.html

This lists noted there are also available in the repo.

Definition of Done 1) create enum for stress types using the names defined here 2) build map of verbs with key value pairs where key=verb and value=stressed syllable enum value 3) create function that will lookup the correct type and use that to correctly double the final consonant

Hunta88 commented 2 years ago