Java name parse library?

前端 未结 5 794
梦如初夏
梦如初夏 2021-01-07 20:58

I\'m searching for a library similar in functionality to the Perl Lingua::EN::NameParse module. Essentially, I\'d like to parse strings like \'Mr. Bob R. Smith\' into prefix

5条回答
  •  暖寄归人
    2021-01-07 21:24

    Personally, I would opt for regular expressions. Here's a good intro. They're fast, concise and always do what you want.

    If you want to stay within the boundaries of the java sdk, use String tokenizers.

    A bit more low-level is JavaCC, a java based parser generator. Here's a link to a tutorial.

    An alternative to javaCC is ANTLR, which I've personally had good experiences with.

提交回复
热议问题