Returns a dictionary definition for the given string.
(self, string)
| 1375 | return s |
| 1376 | |
| 1377 | def definition(self, string): |
| 1378 | """ Returns a dictionary definition for the given string. |
| 1379 | """ |
| 1380 | s = self.answer(string, field="Definition", cached=True) |
| 1381 | s = re.sub(r"^.*? definition: ", "", s) |
| 1382 | s = re.sub(r"(^'''.*?''' |^)(.)(.*?)$", |
| 1383 | lambda m: m.group(1) + m.group(2).upper() + m.group(3), s) |
| 1384 | return s |
| 1385 | |
| 1386 | DDG = DuckDuckGo |
| 1387 |