Discussion:
A3Q3: Consideration of numbers
(too old to reply)
Tony Cui
2011-06-12 23:54:11 UTC
Permalink
Hello, in question 3 of assignment 3, are we supposed to consider words
with numbers in them? From the structure definition, it seems that we do
not, but with the given example, there is a word with numbers in it
("76er").

If we do have to account for numbers, then wouldn't the structure
definition for the node need to include a larger array?
xewang
2011-06-13 00:29:55 UTC
Permalink
Post by Tony Cui
Hello, in question 3 of assignment 3, are we supposed to consider words
with numbers in them? From the structure definition, it seems that we do
not, but with the given example, there is a word with numbers in it
("76er").
If we do have to account for numbers, then wouldn't the structure
definition for the node need to include a larger array?
that word is in the test file not the dictionary file, so

As the dictionary only includes words with lowercase letters and
apostrophe, the words in the input file must be adjusted to conform to
these restrictions. Therefore, uppercase letters must be converted to
lowercase, and certain punctuation (like numbers ) must be removed.
Tony Cui
2011-06-13 00:40:06 UTC
Permalink
Post by xewang
Post by Tony Cui
Hello, in question 3 of assignment 3, are we supposed to consider words
with numbers in them? From the structure definition, it seems that we do
not, but with the given example, there is a word with numbers in it
("76er").
If we do have to account for numbers, then wouldn't the structure
definition for the node need to include a larger array?
that word is in the test file not the dictionary file, so
As the dictionary only includes words with lowercase letters and
apostrophe, the words in the input file must be adjusted to conform to
these restrictions. Therefore, uppercase letters must be converted to
lowercase, and certain punctuation (like numbers ) must be removed.
That is what I initially thought too, but running such case with the
test executable (including "er" in dictionary, and "76er" still in
words) still results in showing "76er" as part of the not-found section.
Adrian Vantyghem
2011-06-13 00:56:06 UTC
Permalink
Numbers are not punctuation. The assignment says which punctuation to
remove from the end of words, and which to remove from the beginning and
end of words.

The assignment also never specifies when you need to remove
punctuation/convert upper case to lower case. Make sure you do it in a
way that you can print out the original word (without punctuation). So
you can remove the punctuation from wherever you save your words, but
don't permanently change them when you convert from upper case to lower
case.
Post by Tony Cui
Post by xewang
Post by Tony Cui
Hello, in question 3 of assignment 3, are we supposed to consider words
with numbers in them? From the structure definition, it seems that we do
not, but with the given example, there is a word with numbers in it
("76er").
If we do have to account for numbers, then wouldn't the structure
definition for the node need to include a larger array?
that word is in the test file not the dictionary file, so
As the dictionary only includes words with lowercase letters and
apostrophe, the words in the input file must be adjusted to conform to
these restrictions. Therefore, uppercase letters must be converted to
lowercase, and certain punctuation (like numbers ) must be removed.
That is what I initially thought too, but running such case with the
test executable (including "er" in dictionary, and "76er" still in
words) still results in showing "76er" as part of the not-found section.
Ashif Harji
2011-06-13 00:56:19 UTC
Permalink
Post by xewang
Post by Tony Cui
Hello, in question 3 of assignment 3, are we supposed to consider words
with numbers in them? From the structure definition, it seems that we do
not, but with the given example, there is a word with numbers in it
("76er").
If we do have to account for numbers, then wouldn't the structure
definition for the node need to include a larger array?
that word is in the test file not the dictionary file, so
As the dictionary only includes words with lowercase letters and apostrophe,
the words in the input file must be adjusted to conform to these
restrictions. Therefore, uppercase letters must be converted to lowercase,
and certain punctuation (like numbers ) must be removed.
Careful. Numbers are not punctuation. The punctuation to be removed are
explicitly mentioned in the assignment and they do not include numbers.
Aside from handling uppercase letters and punctuation, a word containing
any other character cannot be in the dictionary but could still be a
possible word to check. You must handle these words properly.

ashif

Loading...