如何在句子(名字)中找到最近的邻居?

2024-06-26 13:42:45 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一张像下面这样的桌子:

<table><tbody><tr><th>CHILD </th><th>FATHER </th><th>MOTHER</th></tr><tr><td>Jhon Morris </td><td>David Morris </td><td>Alicia Morris</td></tr><tr><td>Charles Reed </td><td>George Reed </td><td>Megan Reed</td></tr><tr><td>Daniel Morris </td><td>David Morris </td><td>Alicia Morris</td></tr><tr><td>Anthony Morris </td><td>Ronald Morris </td><td>Mary Morris</td></tr></tbody></table>

我需要得到最相似的项目,例如: 输入:

John Morris

返回:

Most similar is Daniel Morris' (his brother)

Second most similar is Anthony Morris (his cousin)

我该怎么做


Tags: istabletranthonytddavidsimilarreed