Post by cs246Post by Ian ToffelmirePost by ttIs that possible the word 'a' is in the dictionary? If it is, what is
the number of apostrophes. The given executable returns 1, but should
it be 2?
Considering the question states that you're supposed to take quotation
marks off that surround a word, I would expect the answer is "No, that
is not a possible word".
Actually inside your dictionary that is a valid word that could be
there, but you're right in that you would never actually match that word
from the input file because the apostrophes would be removed.
And to answer the original question, you are asked to find the number of
words with apostrophes inside them, so multiple apostrophes in 1 word is
still just one word.
For clarification, is it acceptable to consider words in the dictionary
which end in apostrophes to cause undefined behaviour?
For instance, the reference implementation does not count the word '''''
as a word containing an apostrophe (I presume because it is stripping
these when reading the dictionary). The assignment specification,
however, only specifies that punctuation should be stripped when reading
the input file (*not* the dictionary).
If this is undefined behaviour, I assume that it will not be tested. If
we are expected to match the behaviour of the reference implementation
in this regard, would it be possible to get clarification about when
punctuation should and should not be considered?
--
Jeremy Roman
Student, Computer Science
University of Waterloo