Chiranjit Saha
Chiranjit Saha

Reputation: 23

Choosing correct word for the given string

Suppose the given word is" connnggggggrrrraaatsss" and we need to convert it to congrats . Or for other example is "looooooovvvvvveeeeee" should be changed to "love" .

Here the given words can be repeated for any number of times but it should be changed to correct form. We need to write a java based program.

Upvotes: 0

Views: 90

Answers (1)

genaks
genaks

Reputation: 757

You cannot really check for every word because there are certain words which have more than 1 alphabets in their spelling. So one way you could go is -

  1. check for each alphabet in the word and restrict its number of consecutive appearances to two
  2. now check the new spelling on the spell checker, you might want to try HUNspell as it is widely used by many word processing softwares.

Upvotes: 2

Related Questions