asdf
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Simple_Not 2023-07-02 12:38:40 +10:00
parent 154e1940f0
commit 23470f4c4c
6 changed files with 379 additions and 3 deletions

277
arang.py Normal file
View File

@ -0,0 +1,277 @@
from arango import ArangoClient
# Initialize the ArangoDB client.
client = ArangoClient(hosts='http://cyberbully:8529')
# Connect to "_system" database as root user.
# This returns an API wrapper for "_system" database.
base0 = client.db('base0', username='root', password='rootpassword')
destructive_verbs = base0.collection('destructive_verbs')
# destructive_verbs.insert({'_key': 'obliterate'}, overwrite_mode='update')
# destructive_verbs.insert({'_key': 'destroy'}, overwrite_mode='update')
# destructive_verbs.insert({'_key': 'erase'}, overwrite_mode='update')
# destructive_verbs.insert({'_key': 'eradicate'}, overwrite_mode='update')
# destructive_verbs.insert({'_key': 'abolish'}, overwrite_mode='update')
# destructive_verbs.insert({'_key': 'cancel'}, overwrite_mode='update')
# destructive_verbs.insert({'_key': 'overturn'}, overwrite_mode='update')
# destructive_verbs.insert({'_key': 'repeal'}, overwrite_mode='update')
# very_high_relevance = base0.collection('very_high_relevance')
# high_relevance = base0.collection('high_relevance')
# very_high_relevance.insert({
# '_key': 'obliterate-erase',
# '_from': 'destructive_verbs/obliterate',
# '_to': 'destructive_verbs/erase'
# }, overwrite_mode='update')
# very_high_relevance.insert({
# '_key': 'obliterate-destroy',
# '_from': 'destructive_verbs/obliterate',
# '_to': 'destructive_verbs/destroy'
# }, overwrite_mode='update')
# very_high_relevance.insert({
# '_key': 'obliterate-abolish',
# '_from': 'destructive_verbs/obliterate',
# '_to': 'destructive_verbs/abolish'
# }, overwrite_mode='update')
# very_high_relevance.insert({
# '_key': 'obliterate-eradicate',
# '_from': 'destructive_verbs/obliterate',
# '_to': 'destructive_verbs/eradicate'
# }, overwrite_mode='update')
# very_high_relevance.insert({
# '_key': 'erase-eradicate',
# '_from': 'destructive_verbs/erase',
# '_to': 'destructive_verbs/eradicate'
# }, overwrite_mode='update')
# very_high_relevance.insert({
# '_key': 'abolish-eradicate',
# '_from': 'destructive_verbs/abolish',
# '_to': 'destructive_verbs/eradicate'
# }, overwrite_mode='update')
# very_high_relevance.insert({
# '_key': 'destroy-eradicate',
# '_from': 'destructive_verbs/destroy',
# '_to': 'destructive_verbs/eradicate'
# }, overwrite_mode='update')
# very_high_relevance.insert({
# '_key': 'erase-abolish',
# '_from': 'destructive_verbs/erase',
# '_to': 'destructive_verbs/abolish'
# }, overwrite_mode='update')
# very_high_relevance.insert({
# '_key': 'erase-destroy',
# '_from': 'destructive_verbs/erase',
# '_to': 'destructive_verbs/destroy'
# }, overwrite_mode='update')
# very_high_relevance.insert({
# '_key': 'cancel-abolish',
# '_from': 'destructive_verbs/cancel',
# '_to': 'destructive_verbs/abolish'
# }, overwrite_mode='update')
# very_high_relevance.insert({
# '_key': 'overturn-abolish',
# '_from': 'destructive_verbs/overturn',
# '_to': 'destructive_verbs/abolish'
# }, overwrite_mode='update')
# very_high_relevance.insert({
# '_key': 'repeal-abolish',
# '_from': 'destructive_verbs/repeal',
# '_to': 'destructive_verbs/abolish'
# }, overwrite_mode='update')
words = {
'obliterate': {
'very_high_relevance': [
'eradicate', 'erase', 'abolish', 'destroy'
],
'high_relevance': [
'annihilate', 'exterminate', 'expunge', 'efface', 'cancel', 'liquidate', 'wipe-out', 'shatter', 'demolish', 'extirpate', 'sweep-(away)', 'blot-out', 'kill', 'clean-(up)'
],
'normal_relevance': [
'stamp (out)', 'dismantle', 'ruin', 'root (out)', 'devastate', 'discard', 'snuff (out)', 'flatten', 'ravage', 'consume', 'decimate', 'rub out', 'dissolve', 'black out', 'wreck', 'fragment', 'smash', 'waste', 'raze',
'devour', 'tear down', 'powder', 'expel', 'mow (down)', 'total', 'eject', 'finish', 'terminate', 'pulverize', 'dash', 'ditch', 'blast', 'kill off', 'excise', 'oust'
]
},
'eradicate': {
'very_high_relevance': [ 'erase', 'abolish', 'destroy'
],
'high_relevance': [ 'obliterate', 'exterminate', 'annihilate', 'expunge', 'extirpate', 'demolish', 'efface', 'wipe out', 'liquidate', 'cancel', 'sweep (away)', 'kill', 'shatter', 'clean (up)', 'dismantle', 'blot out', 'stamp (out)', 'ruin'
],
'normal_relevance': [ 'discard', 'consume', 'root (out)', 'snuff (out)', 'devastate', 'ravage', 'rub out', 'dissolve', 'decimate', 'black out', 'flatten', 'waste', 'expel', 'fragment', 'wreck', 'smash', 'tear down', 'eject', 'dash', 'mow (down)', 'powder', 'devour', 'total', 'finish', 'raze', 'terminate', 'excise', 'oust', 'kill off', 'ditch', 'blow up', 'pulverize'
]
},
'abolish': {
'very_high_relevance': [ 'repeal', 'cancel', 'overturn'
],
'high_relevance': [ 'avoid', 'abrogate', 'nullify', 'annul', 'vacate', 'invalidate', 'rescind', 'dissolve', 'revoke', 'quash', 'negate', 'void', 'withdraw', 'suspend', 'dismiss', 'roll back', 'set aside', 'abate', 'eliminate', 'strike down', 'null', 'reverse', 'remove', 'reject', 'veto'
],
'normal_relevance': [ 'do away with', 'retract', 'disannul', 'overrule', 'forbid', 'prohibit', 'override', 'ban', 'erase', 'eradicate', 'outlaw', 'enjoin', 'abort', 'recall', 'countermand', 'disallow', 'annihilate', 'call off', 'liquidate', 'call', 'drop', 'throw out'
]
},
'devastate': {
'very_high_relevance': [ 'ravage', 'destroy'
],
'high_relevance': [ 'ruin'
],
'normal_relevance': [ 'scourge', 'overwhelm', 'plunder', 'obliterate', 'despoil', 'shatter', 'wreck', 'decimate', 'eradicate', 'desolate', 'sack', 'annihilate', 'pillage', 'vaporize', 'demolish', 'extirpate', 'expunge', 'strip', 'extinguish', 'wipe out', 'loot', 'waste', 'smash', 'total', 'harry', 'maraud', 'overpower', 'raze', 'mow', 'wrack', 'nuke', 'overrun', 'overthrow', 'foray', 'rub out'
]
},
'raze': {
'very_high_relevance': [ 'demolish', 'destroy', 'ruin', 'devastate', 'shatter', 'wreck', 'smash'
],
'high_relevance': [ 'overcome', 'damage', 'annihilate', 'waste', 'decimate', 'pulverize', 'extinguish', 'ravage', 'vaporize', 'erode', 'desolate', 'mar', 'dismantle', 'cream', 'kill', 'tear down', 'cripple', 'pull down', 'nuke'
],
'normal_relevance': [ 'remove', 'total', 'crush', 'rub out', 'defeat', 'do in', 'subdue', 'break', 'injure', 'conquer', 'wrack', 'lick', 'blast', 'best', 'dissolve', 'disintegrate', 'eradicate', 'spoil', 'surmount', 'deface', 'disfigure', 'mutilate', 'impair', 'obliterate', 'master', 'prevail (over)', 'trim', 'win (against)', 'triumph (over)', 'deteriorate', 'scour', 'rout', 'harm', 'exterminate', 'vitiate', 'assassinate', 'undo', 'thrash', 'wear (away)', 'liquidate', 'mangle', 'trounce', 'whip', 'beat', 'extirpate', 'slaughter', 'dynamite', 'sweep (away)', 'disassemble', 'expunge', 'unmake', 'despoil', 'clobber', 'blow up', 'scotch', 'plunder', 'slay', 'efface',
'sack', 'pillage', 'execute', 'trample', 'wipe out', 'overbear', 'fell', 'vandalize', 'wash out', 'gut', 'drub', 'loot', 'overmatch', 'unbuild', 'take down', 'massacre', 'dilapidate', 'murder', 'havoc', 'cut down', 'blot out', 'stamp (out)', 'butcher'
]
},
'eliminate': {
'very_high_relevance': [ 'exclude', 'prevent', 'ban', 'prohibit'
],
'high_relevance': [ 'bar', 'shut out', 'banish', 'rule out', 'debar', 'freeze out', 'expel', 'count (out)', 'except', 'suspend'
],
'normal_relevance': [ 'obviate', 'preclude', "close one's doors to", 'close out', 'hinder', 'deter', 'ostracize', 'impede', 'exile', 'excommunicate', 'deport', 'block', 'cease', 'obstruct', 'oust', 'blacklist', 'blackball', 'halt', 'ward (off)', 'stave off', 'discontinue', 'throw out'
]
},
# 'eliminate': {
# 'very_high_relevance': [
# ],
# 'high_relevance': [
# ],
# 'normal_relevance': [
# ]
# },
'murder': {
'very_high_relevance': [ 'assassinate', 'slay', 'execute', 'kill'
],
'high_relevance': [ 'slaughter', 'dispatch', 'neutralize', 'get', 'snuff', 'off', 'destroy', 'put away', 'take out', 'liquidate', 'terminate', 'ice', 'shoot', 'whack'
],
'normal_relevance': [ 'massacre', 'knock off', 'do away with', 'bump off', 'rub out', 'do in', 'croak', 'blow away', 'cut down', 'butcher', 'shoot down', 'claim', 'carry off', 'fell', 'blot out', 'eliminate', 'eradicate', 'mow (down)', 'smite', 'wipe out', 'exterminate', 'annihilate', 'zap'
]
},
'decimate': {
'very_high_relevance': [ 'destroy', 'devastate', 'ruin', 'demolish', 'shatter', 'wreck', 'smash'
],
'high_relevance': ['overcome', 'damage', 'annihilate', 'erode', 'ravage', 'vaporize', 'waste', 'pulverize', 'extinguish', 'cripple', 'raze', 'desolate', 'kill', 'mar', 'total', 'dismantle', 'tear down', 'cream', 'defeat', 'crush', 'injure', 'rub out',
'pull down'
],
'normal_relevance': [ 'nuke', 'subdue', 'remove', 'break', 'wrack', 'do in', 'best', 'conquer', 'impair', 'spoil', 'blast', 'disintegrate', 'eradicate', 'trim', 'harm', 'disfigure', 'obliterate', 'mutilate', 'deteriorate', 'dissolve', 'lick', 'rout', 'mangle', 'exterminate', 'prevail (over)', 'master', 'win (against)', 'surmount', 'trounce', 'assassinate', 'triumph (over)', 'vitiate', 'clobber', 'scour', 'beat', 'slaughter', 'undo', 'thrash', 'whip', 'extirpate', 'deface', 'wear (away)', 'dynamite', 'sweep (away)', 'expunge', 'liquidate', 'slay', 'blow up', 'overmatch', 'scotch', 'despoil', 'trample', 'sack', 'disassemble', 'execute', 'overbear', 'gut', 'plunder', 'pillage', 'wash out', 'fell', 'wipe out', 'havoc', 'wallop', 'efface', 'unmake', 'drub', 'blot out', 'massacre', 'take down', 'cut down', 'murder', 'stamp (out)', 'loot', 'zap', 'butcher', 'root (out)', 'dispatch', 'kill off', 'vandalize'
]
},
'slay': {
'very_high_relevance': [ 'kill', 'destroy'
],
'high_relevance': [ 'take', 'dispatch', 'fell', 'slaughter', 'murder', 'claim', 'carry off', 'croak', 'assassinate', 'do for'
],
'normal_relevance': [ 'do away with', 'neutralize', 'annihilate', 'smite', 'do in', 'cut down', 'execute', 'decimate', 'massacre', 'make away with', 'butcher', 'finish', 'mow', 'waste', 'snuff', 'kill off', 'off', 'whack', 'put away', 'get', 'take out', 'blot out', 'terminate', 'ice', 'scrag', 'bump off', 'rub out', 'knock off', 'suicide', 'martyr', 'put down', 'euthanize'
]
},
'kill': {
'very_high_relevance': [ 'destroy', 'slay', 'take', 'dispatch'
],
'high_relevance': [ 'murder', 'slaughter', 'assassinate', 'fell', 'claim', 'carry off', 'neutralize', 'get', 'croak'
],
'normal_relevance': [ 'execute', 'waste', 'do for', 'do away with', 'massacre', 'finish', 'annihilate', 'decimate', 'do in', 'cut down', 'off', 'make away with', 'butcher', 'terminate', 'smite', 'kill off', 'snuff', 'mow', 'take out', 'put away', 'whack', 'blot out', 'ice', 'suicide', 'bump off', 'rub out', 'knock off', 'scrag', 'euthanize', 'martyr', 'put down'
]
},
'shatter': {
'very_high_relevance': [ 'destroy', 'ruin', 'demolish', 'devastate', 'smash', 'wreck'
],
'high_relevance': [ 'overcome', 'damage', 'erode', 'pulverize', 'vaporize', 'annihilate', 'decimate', 'extinguish', 'waste', 'mar', 'ravage', 'break', 'cripple', 'raze', 'crush', 'dismantle', 'desolate', 'tear down', 'kill', 'total', 'pull down', 'cream', 'injure'
],
'normal_relevance': [ 'remove', 'rub out', 'disintegrate', 'subdue', 'wrack', 'nuke', 'blast', 'impair', 'do in', 'best', 'conquer', 'dissolve', 'surmount', 'deteriorate', 'spoil', 'harm', 'obliterate', 'disfigure', 'prevail (over)', 'lick', 'eradicate', 'vitiate', 'mutilate', 'win (against)', 'triumph (over)', 'master', 'whip', 'trim', 'mangle', 'fell', 'rout', 'deface', 'dynamite', 'undo', 'scotch', 'beat', 'sweep (away)', 'overbear', 'trample', 'thrash', 'expunge', 'wear (away)', 'unmake', 'blow up', 'assassinate', 'clobber', 'disassemble', 'trounce', 'scour', 'efface', 'wipe out', 'sack', 'exterminate', 'wash out', 'overmatch', 'take down', 'slay', 'slaughter', 'havoc', 'extirpate', 'gut', 'liquidate', 'blot out', 'despoil', 'cut down', 'execute', 'plunder', 'snuff (out)', 'zap', 'drub', 'wallop', 'stamp (out)', 'kill off', 'loot', 'vandalize', 'murder', 'unbuild', 'pillage', 'root (out)'
]
},
'erase': {
'very_high_relevance': [ 'eradicate', 'abolish', 'destroy'
],
'high_relevance': [ 'obliterate', 'expunge', 'efface', 'exterminate', 'cancel', 'annihilate', 'wipe out', 'liquidate', 'sweep (away)', 'shatter', 'demolish', 'blot out', 'clean (up)', 'extirpate', 'stamp (out)'
],
'normal_relevance': [ 'dismantle', 'kill', 'ruin', 'discard', 'root (out)', 'snuff (out)', 'rub out', 'devastate', 'flatten', 'consume', 'ravage', 'black out', 'dissolve', 'decimate', 'fragment', 'waste', 'wreck', 'tear down', 'smash', 'powder', 'finish', 'eject', 'mow (down)', 'total', 'raze', 'terminate', 'expel', 'dash', 'devour', 'ditch', 'blow up', 'excise'
]
},
'quell': {
'very_high_relevance': [ 'subdue', 'suppress', 'repress', 'quash', 'crush'
],
'high_relevance': [ 'stifle', 'extinguish', 'overcome', 'destroy', 'squelch', 'silence', 'sit on', 'squash', 'crack down (on)'
],
'normal_relevance': [ 'demolish', 'quench', 'snuff (out)', 'clamp down (on)', 'slap down', 'put down', 'douse', 'throttle', 'conquer', 'strangle', 'smother', 'ruin', 'dominate', 'obliterate', 'decimate', 'exterminate', 'overwhelm', 'vanquish', 'annihilate', 'put out', 'wreck', 'wipe out', 'subjugate', 'desolate', 'devastate', 'overpower', 'smash', 'dowse', 'waste'
]
},
'destroy': {
'very_high_relevance': [
'ruin', 'demolish', 'devastate', 'shatter', 'wreck', 'smash', 'overcome'
],
'high_relevance': [
'damage',
'waste',
'annihilate',
'erode',
'extinguish',
'decimate',
'vaporize',
'kill',
'dismantle',
'cripple',
'pulverize',
'raze',
'ravage',
'mar',
'remove',
'crush',
'desolate',
'defeat',
'cream',
'injure',
'tear-down',
'subdue',
'pull-down',
'break',
'total',
'nuke',
'rub-out',
'blast',
'conquer'
],
'normal_relevance': [
'spoil', 'wrack', 'do in', 'disintegrate', 'best', 'eradicate', 'impair', 'harm', 'obliterate', 'dissolve', 'assassinate', 'deteriorate', 'mutilate', 'disfigure', 'lick', 'trim', 'master', 'win (against)', 'prevail (over)', 'surmount', 'deface', 'triumph (over)', 'exterminate', 'vitiate', 'undo', 'sweep (away)', 'slaughter', 'rout', 'wear (away)', 'beat', 'dynamite', 'whip', 'extirpate', 'blow up', 'disassemble', 'plunder', 'expunge', 'thrash', 'mangle', 'slay', 'scour', 'wipe out', 'liquidate', 'scotch', 'clobber', 'unmake', 'sack', 'havoc', 'despoil', 'wash out', 'fell', 'execute', 'vandalize', 'trounce', 'overbear', 'trample', 'efface', 'murder', 'loot', 'overmatch', 'blot out', 'gut', 'take down', 'pillage', 'cut down', 'zap', 'kill off', 'massacre', 'snuff (out)', 'unbuild', 'drub', 'stamp (out)', 'dispatch', 'dilapidate', 'take out', 'wallop', 'trash', 'butcher', 'root (out)', 'mow (down)'
]
}
}
def normalize(s):
return s.lower().replace('(', '').replace(')', '').replace(' ', '-')
for w in words:
for k in words[w]:
for d in words[w][k]:
print(f'{w} {k} {d}')
normalized_d = normalize(d)
normalized_w = normalize(w)
normalized_k = normalize(k)
l = sorted([normalized_w, normalized_d])
__key = '-'.join(l)
print(__key)
destructive_verbs.insert({'_key': normalized_d}, overwrite_mode='update')
base0.collection(normalized_k).insert({
'_key': __key,
'_from': f'destructive_verbs/{l[0]}',
'_to': f'destructive_verbs/{l[1]}'
}, overwrite_mode='update')

View File

@ -57,7 +57,11 @@ from Latin: exterminatus
Ориентировочно появилось: late 14c
from Latin: desolatus
from Old French: raser
from Medieval Latin: rasare
frequentative of Latin: radere
----

View File

@ -8,8 +8,8 @@ services:
# stdin_open: true
# tty: true
ports:
- 3100:3000
- 3101:3001
- 5100:3000
- 5101:3001
volumes:
- ./book:/book
command:

36
make_list.py Normal file
View File

@ -0,0 +1,36 @@
# initializing string representation of a list
ini_list = """[
massacre
knock off
do away with
bump off
rub out
do in
croak
blow away
cut down
butcher
shoot down
claim
carry off
fell
blot out
eliminate
eradicate
mow (down)
smite
wipe out
exterminate
annihilate
zap
]"""
# Converting string to list
res = ini_list.strip().strip('][').split('\n') #.split(' ')
print([i for i in res if i])

58
plot.py Normal file
View File

@ -0,0 +1,58 @@
import matplotlib.pyplot as plt
import networkx as nx
from netgraph import Graph
G = nx.Graph( )
#G = Graph( G0, edge_layout='curved')
VERY_HIGH, HIGH, MEDIUM, USUAL = 0.2, 0.4, 0.7, 0.9
G.add_edge("raze", "obliterate", weight=MEDIUM)
G.add_edge("eradicate", "obliterate", weight=VERY_HIGH)
G.add_edge("erase", "obliterate", weight=VERY_HIGH)
G.add_edge("abolish", "obliterate", weight=VERY_HIGH)
G.add_edge("destroy", "obliterate", weight=VERY_HIGH)
G.add_edge("raze", "demolish", weight=VERY_HIGH)
G.add_edge("raze", "destroy", weight=VERY_HIGH)
G.add_edge("raze", "ruin", weight=VERY_HIGH)
G.add_edge("raze", "devastate", weight=VERY_HIGH)
G.add_edge("raze", "shatter", weight=VERY_HIGH)
G.add_edge("raze", "wreck", weight=VERY_HIGH)
G.add_edge("raze", "smash", weight=VERY_HIGH)
elarge = [(u, v) for (u, v, d) in G.edges(data=True) if d["weight"] > 0.5]
esmall = [(u, v) for (u, v, d) in G.edges(data=True) if d["weight"] <= 0.5]
G1 = Graph( G, edge_layout='curved')
nx.draw_networkx_labels(G1, font_size=20, font_family="sans-serif")
plt.show()
#pos = nx.spring_layout(G, seed=7) # positions for all nodes - seed for reproducibility
pos = nx.spring_layout(G)
# nodes
nx.draw_networkx_nodes(G, pos) # , node_size=700)
# edges
nx.draw_networkx_edges(G, pos )
# nx.draw_networkx_edges(G, pos ,# edgelist=elarge, width=6,
# connectionstyle="arc3,rad=0.1")
# nx.draw_networkx_edges(
# G, pos, #edgelist=esmall, width=6, #, alpha=0.5, edge_color="b", #, style="dashed",
# connectionstyle="arc3,rad=0.1"
# )
# node labels
nx.draw_networkx_labels(G, pos, font_size=20, font_family="sans-serif")
# edge weight labels
edge_labels = nx.get_edge_attributes(G, "weight")
nx.draw_networkx_edge_labels(G, pos, edge_labels)
ax = plt.gca()
ax.margins(0.08)
plt.axis("off")
plt.tight_layout()
plt.show()

1
scr.py
View File

@ -21,6 +21,7 @@ if len(sys.argv) > 1:
### {sys.argv[1]}
#### [etymonline.com / {sys.argv[1]}](https://www.etymonline.com/word/{sys.argv[1]})
#### [merriam-webster.com / {sys.argv[1]}](https://www.merriam-webster.com/dictionary/{sys.argv[1]})
#### [merriam-webster.com / thesaurus / {sys.argv[1]}](https://www.merriam-webster.com/thesaurus/{sys.argv[1]})
![by years](images/{sys.argv[1]}/years.png)