0

So the only error I get is not correct possessives handling. Why it doesn't help to use this in check function:

if ((int) word[i] == 39)
{
    return false;
}

?

1
  • 1
    there's no way to answer this without some context. How are you using it? Why do you say that it is a problem? What are the symptoms? What doesn't work? You need to provide more details and/or code. – Cliff B Nov 5 '15 at 2:24
1

What you seem to be doing, from the little snippet of code you provide, is returning false when a possessive is found. Not sure why you would do that, since there's words in the dictionary that have possessives and, if they're in the dictionary, you shouldn't return false when one such word also appears in the text you're checking.

It's hard to tell anything else without knowing more about your data structure, but returning false every time an apostrophe appears in the text is clearly incorrect.

2
  • well, I don't understand. So my codes finds evil's to be correct, whereas staff code says it is incorrect, so I am trying to make all words with " ' " return false, but I don't we the code I have posted works – Laurynas G Nov 5 '15 at 8:10
  • "evil's" shouldn't be correct, because "evil's" as a word is not in the dictionary. On the other hand, word's like "I'm", "you're", etc., are in the dictionary and your check shouldn't return false when those words appear. Returning all words with "'" as false is not correct. Again, there's no way to tell why or how the rest of the code works with what you posted. So edit your post and include, at least, the whole check function. – Irene Nov 5 '15 at 22:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .