• Feathercrown@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    7 months ago

    I am curious how you’d deal with the ambiguity of contractions vs. ending single quotes. I guess that character between letters can be assumed to be part of the word, but not if it’s between a letter and a space, for example. If you ignore contractions, hyphenated words, and accented characters, you could just match on /[a-zA-Z]+/.

    • lunarul@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      7 months ago

      I am curious how you’d deal with the ambiguity of contractions vs. ending single quotes

      That’s the thing, nobody even asks this question.

      you could just match on /[a-zA-Z]+/

      That would already put you in the top 10% of solutions I’ve seen so far on this problem.

      • Feathercrown@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        7 months ago

        My confidence in my job security and general programming abilities has skyrocketed after visiting this thread