Skip to content

Commit

Permalink
Merge pull request #14 from Fania/thesis
Browse files Browse the repository at this point in the history
Thesis
  • Loading branch information
Fania authored Aug 12, 2016
2 parents 8efc58a + 331ddfe commit 5fd81f9
Show file tree
Hide file tree
Showing 37 changed files with 269 additions and 10 deletions.
52 changes: 46 additions & 6 deletions app/textsurfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,15 @@ def get_nym(nym, wset):
if nym == 'hyper':
hhh = wset.hypernyms()
if nym == 'holo':
hhh = wset.member_holonyms()
hhhm = wset.member_holonyms()
hhhs = wset.substance_holonyms()
hhhp = wset.part_holonyms()
hhh = hhhm + hhhs + hhhp
if nym == 'mero':
hhh = wset.part_meronyms()
hhhm = wset.member_meronyms()
hhhs = wset.substance_meronyms()
hhhp = wset.part_meronyms()
hhh = hhhm + hhhs + hhhp
if len(hhh) > 0:
for h in hhh:
for l in h.lemmas():
Expand All @@ -233,6 +239,12 @@ def get_nym(nym, wset):
# f = "thesis" + st + ".txt"
# with open(f, "a") as mylog:
# mylog.write(p)
# ts = time.time()
# st = datetime.datetime.fromtimestamp(ts).strftime('%d%m%y%H%M%S')
# p = nym + ", " + str(wset) + ", " + str(len(hhh)) + "\n"
# f = "syzygy" + st + ".txt"
# with open(f, "a") as mylog:
# mylog.write(p)
return out


Expand Down Expand Up @@ -264,12 +276,40 @@ def clinamen(w, c, i):

def syzygy(w, c):
words = set()
hypos = set()
hypers = set()
holos = set()
meros = set()
wordsets = wn.synsets(w)
hypo_len, hyper_len, holo_len, mero_len, syno_len = 0,0,0,0,0
for ws in wordsets:
words.update(get_nym('hypo', ws))
words.update(get_nym('hyper', ws))
words.update(get_nym('holo', ws))
words.update(get_nym('mero', ws))
hypos.update(get_nym('hypo', ws))
hypo_len += len(hypos)
words.update(hypos)
hypers.update(get_nym('hyper', ws))
hyper_len += len(hypers)
words.update(hypers)
holos.update(get_nym('holo', ws))
holo_len += len(holos)
words.update(holos)
meros.update(get_nym('mero', ws))
mero_len += len(meros)
words.update(meros)
syno_len += 1
# ts = time.time()
# st = datetime.datetime.fromtimestamp(ts).strftime('%d%m%y%H%M%S')
# p0 = w + " - synos: " + str(wordsets) + "\n"
# p1 = w + " - hypos: " + str(hypos) + "\n"
# p2 = w + " - hypers: " + str(hypers) + "\n"
# p3 = w + " - holos: " + str(holos) + "\n"
# p4 = w + " - meros: " + str(meros) + "\n"
# f = "syzygy" + st + ".txt"
# with open(f, "a") as mylog:
# mylog.write(p0)
# mylog.write(p1)
# mylog.write(p2)
# mylog.write(p3)
# mylog.write(p4)
# print('inside syzygy function: ', words)
out, sources, total = get_results(words, 'Syzygy', c)
return out, words, sources, total
Expand Down
5 changes: 1 addition & 4 deletions app/textviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,14 @@ def textresults():
# clin_words = ['hello', 'world', 'fania', 'loves', 'dave']

clin_sens, clin_words, clin_files, clin_tot = clinamen(query, corpus, 2)
# clin_sens, clin_words, clin_files, clin_tot = clinamen(query, corpus, 2)

sys_sens, sys_words, sys_files, sys_tot = syzygy(query, corpus)
anti_sens, anti_words, anti_files, anti_tot = antinomy(query, corpus)

all_sens = list(clin_sens | sys_sens | anti_sens)
all_tot = clin_tot + sys_tot + anti_tot

all_files = set([f[0] for f in all_sens])
all_words = set([f[1] for f in all_sens]) # first occurance
# all_words = set([f[1][1] for f in all_sens]) # each occurance
all_words = set([f[1][1] for f in all_sens])

lol, part, mx = calc_all(all_sens)

Expand Down
52 changes: 52 additions & 0 deletions log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,55 @@ textresults post: peg faustroll
textresults post: Thu Aug 11 17:47:04 2016 [clear] faustroll
textresults post: Thu Aug 11 17:47:35 2016 [pronounce] faustroll
textresults post: Thu Aug 11 17:47:45 2016 [fania] shakespeare
textresults post: 08/12/16 13:36:14 [clear] faustroll
textresults post: 08/12/16 13:37:43 [clear] faustroll
textresults post: 08/12/16 13:40:25 [clear] faustroll
textresults post: 08/12/16 13:49:46 [clear] faustroll
textresults post: 08/12/16 13:51:07 [clear] faustroll
textresults post: 08/12/16 13:54:32 [clear] faustroll
textresults post: 08/12/16 13:54:54 [feather] faustroll
textresults post: 08/12/16 13:55:19 [death] faustroll
textresults post: 08/12/16 13:55:41 [flight] faustroll
textresults post: 08/12/16 13:55:59 [page] faustroll
textresults post: 08/12/16 13:56:11 [book] faustroll
textresults post: 08/12/16 13:56:30 [seed] faustroll
textresults post: 08/12/16 13:56:37 [web] faustroll
textresults post: 08/12/16 14:16:45 [clear] faustroll
textresults post: 08/12/16 14:17:50 [feather] faustroll
textresults post: 08/12/16 14:18:32 [death] faustroll
textresults post: 08/12/16 14:18:41 [page] faustroll
textresults post: 08/12/16 14:18:45 [book] faustroll
textresults post: 08/12/16 14:18:48 [seed] faustroll
textresults post: 08/12/16 14:18:53 [web] faustroll
textresults post: 08/12/16 14:22:56 [clear] faustroll
textresults post: 08/12/16 14:24:43 [feather] faustroll
textresults post: 08/12/16 14:25:40 [feather] faustroll
textresults post: 08/12/16 14:27:30 [page] faustroll
textresults post: 08/12/16 14:32:35 [seed] faustroll
textresults post: 08/12/16 14:33:32 [seed] faustroll
textresults post: 08/12/16 14:34:28 [clear] faustroll
textresults post: 08/12/16 14:34:33 [feather] faustroll
textresults post: 08/12/16 14:34:36 [death] faustroll
textresults post: 08/12/16 14:34:40 [page] faustroll
textresults post: 08/12/16 14:34:44 [book] faustroll
textresults post: 08/12/16 14:34:47 [web] faustroll
textresults post: 08/12/16 14:34:58 [feather] shakespeare
textresults post: 08/12/16 15:06:20 [flower] faustroll
textresults post: 08/12/16 15:22:51 [flower] faustroll
textresults post: 08/12/16 15:23:15 [flower] shakespeare
textresults post: 08/12/16 15:23:27 [clear] faustroll
textresults post: 08/12/16 15:23:34 [clear] shakespeare
textresults post: 08/12/16 15:23:43 [troll] faustroll
textresults post: 08/12/16 15:23:52 [troll] shakespeare
textresults post: 08/12/16 15:24:00 [fania] faustroll
textresults post: 08/12/16 15:24:04 [fania] shakespeare
textresults post: 08/12/16 15:24:43 [clear] faustroll
textresults post: 08/12/16 15:25:59 [shine] faustroll
textresults post: 08/12/16 15:26:44 [disorder] faustroll
textresults post: 08/12/16 15:29:01 [stuck] faustroll
textresults post: 08/12/16 15:30:07 [clear] shakespeare
textresults post: 08/12/16 15:30:33 [shine] shakespeare
textresults post: 08/12/16 15:30:58 [disorder] shakespeare
textresults post: 08/12/16 15:31:04 [stuck] shakespeare
textresults post: 08/12/16 15:34:22 [feather] shakespeare
textresults post: 08/12/16 15:36:36 [feather] faustroll
5 changes: 5 additions & 0 deletions syzygy120816141650.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
clear - synos: 45
clear - hypos: 41
clear - hypers: 65
clear - holos: 0
clear - meros: 0
5 changes: 5 additions & 0 deletions syzygy120816141751.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
feather - synos: 7
feather - hypos: 14
feather - hypers: 14
feather - holos: 3
feather - meros: 8
5 changes: 5 additions & 0 deletions syzygy120816141833.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
death - synos: 8
death - hypos: 34
death - hypers: 13
death - holos: 4
death - meros: 0
5 changes: 5 additions & 0 deletions syzygy120816141842.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
page - synos: 9
page - hypos: 14
page - hypers: 13
page - holos: 0
page - meros: 7
5 changes: 5 additions & 0 deletions syzygy120816141846.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
book - synos: 15
book - hypos: 85
book - hypers: 32
book - holos: 2
book - meros: 22
5 changes: 5 additions & 0 deletions syzygy120816141850.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
seed - synos: 13
seed - hypos: 39
seed - hypers: 35
seed - holos: 0
seed - meros: 12
5 changes: 5 additions & 0 deletions syzygy120816141854.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
web - synos: 8
web - hypos: 10
web - hypers: 15
web - holos: 4
web - meros: 1
5 changes: 5 additions & 0 deletions syzygy120816143337.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
seed - synos: [Synset('seed.n.01'), Synset('seed.n.02'), Synset('seeded_player.n.01'), Synset('source.n.03'), Synset('semen.n.01'), Synset('seed.v.01'), Synset('seed.v.02'), Synset('seed.v.03'), Synset('sow.v.01'), Synset('seed.v.05'), Synset('seed.v.06'), Synset('seed.v.07'), Synset('seed.v.08')]
seed - hypos: set(['milt', "Job's_tears", 'nut', 'inseminate', 'caryopsis', 'taproot', 'ivory_nut', 'sow', 'buckeye', 'pip', 'jumping_seed', 'edible_seed', 'conker', 'coffee_berry', 'coquilla_nut', 'jumping_bean', 'sow_in', 'nicker_seed', 'neem_seed', 'coffee', 'vegetable_ivory', 'ash-key', 'bonduc_nut', 'muse', 'oilseed', 'bean', 'oil-rich_seed', 'babassu_nut', 'broadcast', 'cohune_nut', 'Mexican_jumping_bean', 'coffee_bean', 'grain', 'reseed', 'nicker_nut', 'safflower_seed', 'horse_chestnut', 'apple_nut', 'scatter'])
seed - hypers: set(['ovule', 'shed', 'set', 'humour', 'grade', 'rank', 'liquid_body_substance', 'rate', 'take', 'participant', 'inoculate', 'take_away', 'player', 'disgorge', 'treat', 'body_fluid', 'process', 'finance', 'bodily_fluid', 'pose', 'bear', 'fruit', 'turn_out', 'lay', 'put', 'humor', 'inspiration', 'spill', 'remove', 'range', 'place', 'withdraw', 'position', 'order'])
seed - holos: set([])
seed - meros: set(['kernel', 'endosperm', 'meat', 'episperm', 'pericarp', 'testa', 'spermatozoan', 'seed_coat', 'spermatozoon', 'sperm', 'sperm_cell', 'seed_vessel'])
5 changes: 5 additions & 0 deletions syzygy120816143429.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
clear - synos: [Synset('clear.n.01'), Synset('open.n.01'), Synset('unclutter.v.01'), Synset('clear.v.02'), Synset('clear_up.v.04'), Synset('authorize.v.01'), Synset('clear.v.05'), Synset('pass.v.09'), Synset('clear.v.07'), Synset('clear.v.08'), Synset('clear.v.09'), Synset('clear.v.10'), Synset('clear.v.11'), Synset('clear.v.12'), Synset('net.v.02'), Synset('net.v.01'), Synset('gain.v.08'), Synset('clear.v.16'), Synset('clear.v.17'), Synset('acquit.v.01'), Synset('clear.v.19'), Synset('clear.v.20'), Synset('clear.v.21'), Synset('clear.v.22'), Synset('clear.v.23'), Synset('clear.v.24'), Synset('clear.a.01'), Synset('clear.s.02'), Synset('clear.s.03'), Synset('clear.a.04'), Synset('clear.s.05'), Synset('clear.s.06'), Synset('clean.s.03'), Synset('clear.s.08'), Synset('clear.s.09'), Synset('well-defined.a.02'), Synset('clear.a.11'), Synset('clean.s.02'), Synset('clear.s.13'), Synset('clear.s.14'), Synset('clear.s.15'), Synset('absolved.s.01'), Synset('clear.s.17'), Synset('clear.r.01'), Synset('clearly.r.04')]
clear - hypos: set(['stump', 'shovel_in', 'sanction', 'formalise', 'bare', 'rake_in', 'strip', 'gross', 'approbate', 'vindicate', 'certificate', 'profit', 'pay', 'certify', 'O.K.', 'commission', 'disforest', 'rake_off', 'formalize', 'whitewash', 'okay', 'hop', 'denudate', 'eke_out', 'take_home', 'clear-cut', 'deforest', 'bear', 'bring_home', 'licence', 'validate', 'turn_a_profit', 'squeeze_out', 'license', 'clear', 'denude', 'yield', 'purge', 'disafforest', 'approve', 'declare'])
clear - hypers: set(['take_out', 'determine', 'win', 'pronounce', 'judge', 'yield', 'square_up', 'pass', 'rid', 'vanish', 'square_off', 'disappear', 'sell', 'overhaul', 'area', 'disembarrass', 'pay', 'make', 'take_away', 'benefit', 'label', 'clear_up', 'take', 'deliver_the_goods', 'alter', 'empty', 'allow', 'get', 'elucidate', 'acquire', 'modify', 'free', 'clarify', 'countenance', 'succeed', 'let', 'bear', 'innocence', 'go_away', 'discharge', 'change', 'overtake', 'move_out', 'country', 'clear', 'remove', 'profit', 'come_through', 'settle', 'withdraw', 'permit', 'create', 'bring_home_the_bacon', 'gain'])
clear - holos: set([])
clear - meros: set([])
5 changes: 5 additions & 0 deletions syzygy120816143434.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
feather - synos: [Synset('feather.n.01'), Synset('feather.n.02'), Synset('feather.v.01'), Synset('feather.v.02'), Synset('feather.v.03'), Synset('feather.v.04'), Synset('fledge.v.03')]
feather - hypos: set(['down_feather', 'quill_feather', 'aftershaft', 'bastard_wing', 'scapular', 'alula', 'spurious_wing', 'flight_feather', 'down', 'marabou', 'contour_feather', 'hackle', 'quill', 'pinion'])
feather - hypers: set(['body_covering', 'acquire', 'join', 'get', 'conjoin', 'cover', 'paddle', 'grow', 'produce', 'animal_material', 'develop', 'rotation', 'rotary_motion', 'row'])
feather - holos: set(['rowing', 'bird', 'row'])
feather - meros: set(['shaft', 'calamus', 'web', 'ceratin', 'vane', 'melanin', 'keratin', 'quill'])
5 changes: 5 additions & 0 deletions syzygy120816143437.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
death - synos: [Synset('death.n.01'), Synset('death.n.02'), Synset('death.n.03'), Synset('death.n.04'), Synset('death.n.05'), Synset('death.n.06'), Synset('end.n.06'), Synset('death.n.08')]
death - hypos: set(['wrongful_death', 'SIDS', 'martyrdom', 'cell_death', 'eternal_rest', 'rest', 'eternal_sleep', 'sleep', 'extinction', 'brain_death', 'neonatal_death', 'mortification', 'infant_death', 'going', 'exit', 'gangrene', 'defunctness', 'cot_death', 'quietus', 'fatality', 'cerebral_death', 'grave', 'sphacelus', 'loss', 'megadeath', 'sudden_infant_death_syndrome', 'necrosis', 'necrobiosis', 'departure', 'expiration', 'crib_death', 'release', 'passing', 'human_death'])
death - hypers: set(['end', 'alteration', 'killing', 'ending', 'state', 'kill', 'putting_to_death', 'modification', 'organic_phenomenon', 'change'])
death - holos: set(['lifetime', 'life', 'life-time', 'lifespan'])
death - meros: set([])
5 changes: 5 additions & 0 deletions syzygy120816143441.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
page - synos: [Synset('page.n.01'), Synset('page.n.02'), Synset('page.n.03'), Synset('page.n.04'), Synset('page.n.05'), Synset('page.n.06'), Synset('page.v.01'), Synset('page.v.02'), Synset('foliate.v.04')]
page - hypos: set(['facing_pages', 'gatefold', 'sports_page', 'half_title', 'title_page', 'spread_head', 'spreadhead', 'spread', 'verso', 'recto', 'half_page', 'foldout', 'full_page', 'bastard_title'])
page - hypers: set(['folio', 'leaf', 'work', 'errand_boy', 'summon', 'attender', 'messenger_boy', 'tender', 'number', 'attendant'])
page - holos: set([])
page - meros: set(['pagination', 'dog-ear', 'folio', 'paging', 'paper', 'page_number', 'margin'])
5 changes: 5 additions & 0 deletions syzygy120816143445.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
book - synos: [Synset('book.n.01'), Synset('book.n.02'), Synset('record.n.05'), Synset('script.n.01'), Synset('ledger.n.01'), Synset('book.n.06'), Synset('book.n.07'), Synset('koran.n.01'), Synset('bible.n.01'), Synset('book.n.10'), Synset('book.n.11'), Synset('book.v.01'), Synset('reserve.v.04'), Synset('book.v.03'), Synset('book.v.04')]
book - hypos: set(['sketch_pad', 'schoolbook', 'paperback', 'hold_open', 'trade_edition', 'reference', 'text', 'pharmacopeia', 'soft-cover_book', 'authority', 'prompt_copy', 'prayerbook', 'pamphlet', 'phrase_book', 'playbook', 'Epistle', 'fine', 'appointment_book', 'keep_open', 'appointment_calendar', 'subsidiary_ledger', 'album', 'paper-back_book', 'folio', 'review_copy', 'daybook', 'sketch_block', 'continuity', 'pop-up_book', 'yearbook', 'paperback_book', 'storybook', 'sketchbook', 'catalogue', 'hardcover', 'pop-up', 'libretto', 'folder', 'scorecard', 'shooting_script', 'curiosa', 'won-lost_record', 'trade_book', 'dialogue', 'dialog', 'reference_book', 'prayer_book', 'booklet', 'journal', 'songbook', 'save', 'soft-cover', 'catalog', 'notebook', 'textbook', 'brochure', 'cost_ledger', 'ticket', 'bestiary', 'general_ledger', 'card', 'formulary', 'book_of_facts', 'coffee-table_book', 'order_book', 'novel', 'catechism', 'school_text', 'scenario', 'reference_work', 'screenplay', 'family_Bible', 'text_edition', 'softback_book', 'keep', 'leaflet', 'copybook', 'picture_book', 'promptbook', 'hardback', 'workbook', 'softback', 'logbook', 'tome'])
book - hypers: set(['call_for', 'sacred_writing', 'publication', 'sacred_text', 'section', 'production', 'bespeak', 'product', 'dramatic_composition', 'schedule', 'aggregation', 'collection', 'religious_text', 'put_down', 'religious_writing', 'subdivision', 'dramatic_work', 'register', 'request', 'record', 'quest', 'fact', 'enter', 'accumulation', 'assemblage'])
book - holos: set(['text', 'textual_matter'])
book - meros: set(['fore_edge', 'Old_Testament', 'sura', 'spine', 'binding', 'running_head', 'backbone', 'cover', 'back', 'rule', 'running_headline', 'Testament', 'accounting', 'method_of_accounting', 'text', 'prescript', 'signature', 'accounting_system', 'foredge', 'New_Testament', 'book_binding'])
5 changes: 5 additions & 0 deletions syzygy120816143448.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
web - synos: [Synset('web.n.01'), Synset('web.n.02'), Synset('vane.n.04'), Synset('network.n.01'), Synset('world_wide_web.n.01'), Synset('web.n.06'), Synset('web.n.07'), Synset('web.v.01')]
web - hypos: set(['webbing', "spider's_web", 'support_system', 'spider_web', 'reticulum', 'espionage_network', 'old_boy_network', 'tent'])
web - hypers: set(['textile', 'material', 'blade', 'fabric', 'computer_network', 'object', 'system', 'tissue_layer', 'physical_object', 'cloth', 'tissue', 'trap', 'membrane', 'scheme', 'weave'])
web - holos: set(['plumage', 'feather', 'plume', 'webfoot'])
web - meros: set(['barb'])
5 changes: 5 additions & 0 deletions syzygy120816143459.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
feather - synos: [Synset('feather.n.01'), Synset('feather.n.02'), Synset('feather.v.01'), Synset('feather.v.02'), Synset('feather.v.03'), Synset('feather.v.04'), Synset('fledge.v.03')]
feather - hypos: set(['down_feather', 'quill_feather', 'aftershaft', 'bastard_wing', 'scapular', 'alula', 'spurious_wing', 'flight_feather', 'down', 'marabou', 'contour_feather', 'hackle', 'quill', 'pinion'])
feather - hypers: set(['body_covering', 'acquire', 'join', 'get', 'conjoin', 'cover', 'paddle', 'grow', 'produce', 'animal_material', 'develop', 'rotation', 'rotary_motion', 'row'])
feather - holos: set(['rowing', 'bird', 'row'])
feather - meros: set(['shaft', 'calamus', 'web', 'ceratin', 'vane', 'melanin', 'keratin', 'quill'])
Loading

0 comments on commit 5fd81f9

Please sign in to comment.