Z
Zethex
At the moment i'm doing a piece of work for school and I'm stuck at the
moment.
I have a list of words, for example:
Sentence = ['A', 'dog', 'walked', 'across', 'the', 'street']
I have another list which I need to use to replace certain words, and its in
the form of:
synonyms = [
[canine, [dog, puppy, bulldog]],
[ road, [street, avenue, court]]
]
What the procedure must do is replace dog with canine, and street with road.
Therefore if a word is in the sentence and appears on the right side of the
list entry, replace it with the left entry.
I can't seem to find a help file with what I'm after. I'm just wondering if
anyone can help me on the right track on how to start this procedure, maybe
not an answer but just a little help on how to get started as I'm complete
stuck right now.
moment.
I have a list of words, for example:
Sentence = ['A', 'dog', 'walked', 'across', 'the', 'street']
I have another list which I need to use to replace certain words, and its in
the form of:
synonyms = [
[canine, [dog, puppy, bulldog]],
[ road, [street, avenue, court]]
]
What the procedure must do is replace dog with canine, and street with road.
Therefore if a word is in the sentence and appears on the right side of the
list entry, replace it with the left entry.
I can't seem to find a help file with what I'm after. I'm just wondering if
anyone can help me on the right track on how to start this procedure, maybe
not an answer but just a little help on how to get started as I'm complete
stuck right now.