Discussion:
A3Q3 - find function and word formatting
(too old to reply)
Alex Walter
2011-06-13 20:47:57 UTC
Permalink
I'm really confused about this for the find function:

"uppercase letters must be converted to lowercase, and certain
punctuation must be removed. Specifically, all punctuation characters,
[.,!?;:], appearing at the end of a word and all quoting characters,
[’"], appearing at the beginning or end of a word are removed."

Are we supposed to modify the word to the given specifications before
calling find so that find always takes in a properly formatted word? Or
is this supposed be be part of the functionality of the find function
itself?

I initially assumed that we were supposed to modify the word first. But
then when testing the solution executable with "'HeLLo!'" in the input
file and the dictionary empty, the output is:

Words not found in dictionary:
HeLLo

It appears that the case conversion is done in the find function and the
punctuation removal is not. Also, does the output of not found words
happen outside of the find function?
Ashif Harji
2011-06-13 21:08:25 UTC
Permalink
These implementation details are not specificed by the assignment. They
are up to you. There is no requirement that they are done using only one
particular method.

ashif
"uppercase letters must be converted to lowercase, and certain punctuation
must be removed. Specifically, all punctuation characters, [.,!?;:],
appearing at the end of a word and all quoting characters, [’"], appearing at
the beginning or end of a word are removed."
Are we supposed to modify the word to the given specifications before calling
find so that find always takes in a properly formatted word? Or is this
supposed be be part of the functionality of the find function itself?
I initially assumed that we were supposed to modify the word first. But then
when testing the solution executable with "'HeLLo!'" in the input file and
HeLLo
It appears that the case conversion is done in the find function and the
punctuation removal is not. Also, does the output of not found words happen
outside of the find function?
Continue reading on narkive:
Loading...