-
For job application essays, I needed a tool to keep track of word count.
-
InspecText is a word counting app, adapted from a tutorial by the Coding Artist.
-
Core features include word and character count, string reversal, substring search, and palindrome validation.
-
For enhanced functionality, the following features were implemented:
- Keyboard navigation
- Regex usage to handle edge cases
- Responsiveness to mobile landscape orientation
- Buttons for clearing text and copying to the clipboard.
-
InspecText was personally rewarding to create, as the process was a great education on the topics of validation, regular expressions, best practices, functionality, and refactoring.
git clone [email protected]:emjose/inspectext.git && cd inspectext
open index.html
-
A period may automatically insert after double-spacing in the textarea.
-
Instructions on how to disable this keyboard setting.
• InspecText counts words and characters, which include emojis, whitespaces, and line breaks.
• Users can reverse strings and search for substrings in text. Search is case-insensitive.
• Each emoji will register as one word comprised of two or more characters.
• A reversed emoji may appear as �� (replacement characters) if its backwards unicode sequence is invalid.
• InspecText is a progressive web app.
GIF demo: Copying and clearing text
• Users can clear text and reset the app.
• The textarea or inspection results can be copied to the clipboard.
GIF demo: Palindrome validation
• Users can test strings for palindrome validation.
• Whitespaces, capitalization, and punctuation characters are ignored.
• Strings that only contain punctuation characters.
• Strings with emojis and/or non-alphanumeric characters.
• Alphanumeric strings that do not read the same forwards or backwards.
Words, Names, and Dates
- I
- a
- yay
- wow
- Otto
- civic
- Anna
- tenet
- kayak
- rotator
- racecar
- Hannah
- 2/22/22
Phrases and Sentences
- Step on no pets!
- Stressed desserts
- So many dynamos.
- Never odd or even.
- Won't lovers revolt now?
- Oozy rat in a sanitary zoo.
- Murder for a jar of red rum.
- Oh, who was it I saw? Oh, who?
- Did Hannah see bees? Hannah did.
- Cigar? Toss it in a can. It is so tragic.
- Are we not drawn onward, we few, drawn onward to new era?
- Are we not pure? “No, sir!” Panama’s moody Noriega brags. “It is garbage!” Irony dooms a man—a prisoner up to new era.