5 kyu

A simple English to Japanese transliterator

Description
Loading description...
Strings
Algorithms
View
AllIssues1QuestionsSuggestions3Show Resolved
  • Please sign in or sign up to leave a comment.
  • Opabinia Avatar

    It's a lovely kata! Great for someone who studies Japanese, with an interest in computational linguistics.

    But argh, do you know what? I spent hours upon hours building a neat little parser with the Parsec library—reading tutorials, getting deep into the methodology. And only then did I realize that you can't import Text.Parsec in Codewars. Oh dear!

  • allmeta Avatar

    This should be at least 4 kyu

  • solitude Avatar

    This comment has been hidden.

  • muesli4 Avatar

    Well, the description doesn't say much. Does the longest possible match get picked? Or in the existing order? Could have saved me some time.

  • bkaes Avatar

    Somehow, I think that using an additional random check on pattern only strings (like "aaaaaaaaaaaaaiaiiaiai", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", etc) is reasonable on this kata. Something like

    it "`translit` should transliterate strings" $
      conjoin [
        property $ \s -> translit s == solution s,
        property $ forAll (fmap (concatMap fst) . listOf1 . elements $ patterns) $ \s -> translit s == solution s
      ]