normalize is a chain of string methods: each one returns a new string, and the next method works on that one. Watch the sentence change link by link, then move, remove or add links and see which sentences ELIZA can still answer. The order matters.| sentence | normalize(sentence) | i_am_reply(sentence) |
|---|
Every sentence in the table is an "I am" sentence, so ideally all of them get a reply. Which chain answers the most?
Built to accompany COSC 1210 (CS I, Python), lecture “Why are you tired?” (strings I). The string methods run live in your browser and follow Python's rules: replace replaces every occurrence and is case-sensitive, strip(".!?") removes those characters only at the two ends, strip() removes whitespace. The next step, re.sub, is in the Pattern Lab.