Skip to content

Conversation

@dpuglielli
Copy link
Collaborator

Summary

  • Extract core logic to pig-latin.js module with 4 exported functions
  • Add isPigLatin(word) for single word detection (vowel-"way" and consonant-"ay" patterns)
  • Add containsPigLatin(text) for text-level detection (returns true if ANY word matches)
  • Update REPL to warn and skip conversion if input contains Pig Latin
  • Add comprehensive test suite (26 tests)

Test plan

  • Run npm test - all 26 tests pass
  • Run npm start and test:
    • "hello world" converts to "ellohay orldway"
    • "ellohay orldway" shows "Input appears to be Pig Latin already"
    • "hello ellohay" (mixed) shows "Input appears to be Pig Latin already"

Closes #2

- extract core logic to pig-latin.js module
- add isPigLatin function for single word detection
- add containsPigLatin function for text-level detection
- update REPL to skip conversion if pig latin detected
- add 26 tests covering all functionality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detect if input text is already Pig Latin

2 participants