Skip to content

Instantly share code, notes, and snippets.

@LowriWilliams
Last active January 25, 2021 14:54
Show Gist options
  • Save LowriWilliams/860eb59bdca6bebc67de0424eec2804e to your computer and use it in GitHub Desktop.
Save LowriWilliams/860eb59bdca6bebc67de0424eec2804e to your computer and use it in GitHub Desktop.
wn/meronyms.ipynb
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 41,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[Synset('burl.n.02'), Synset('crown.n.07'), Synset('limb.n.02'), Synset('stump.n.01'), Synset('trunk.n.01')]\n",
"\n",
"\n",
"[Synset('heartwood.n.01'), Synset('sapwood.n.01')]\n"
]
}
],
"source": [
"tree = wn.synset('tree.n.01')\n",
" \n",
"print(tree.part_meronyms())\n",
"print('\\n')\n",
"print(tree.substance_meronyms())"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment