attempts to fix bugs

This commit is contained in:
Cristina Cochior 2019-05-21 11:54:11 +02:00
parent eddde7023c
commit ebdbcddc53
57 changed files with 1558 additions and 48056 deletions

BIN
.DS_Store vendored

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@ import sys, os
import json import json
import re import re
with open('wordlist.json', 'r', encoding='utf-8') as f: with open('wordlist.json', 'r') as f:
wordlist_dict = json.load(f) wordlist_dict = json.load(f)
path = "static/files/" path = "static/files/"
@ -10,10 +10,10 @@ for path, subdirs, files in os.walk(path):
for name in files: for name in files:
if name.endswith('html'): if name.endswith('html'):
file = os.path.join(path, name) file = os.path.join(path, name)
with open(file, 'r+', encoding='ISO-8859-1') as f: with open(file, 'r+') as f:
textfile = f.read() textfile = f.read()
for word in wordlist_dict: for word in wordlist_dict:
word = re.escape(word) # word = re.escape(word)
textfile = re.sub(r"(?<!<)(?<!</)(?<!ge\?)\b(%s)\b" %word, r"<a href='/diverge?search=\1'>\1</a>", textfile) textfile = re.sub(r"(?<!<)(?<!</)(?<!ge\?)\b(%s)\b" %word, r"<a href='/diverge?search=\1'>\1</a>", textfile)
f.truncate(0) f.truncate(0)
f.write(textfile) f.write(textfile)

View File

@ -1,37 +0,0 @@
[
"item" : "17",
"sentences" : [
"George Brecht (August 27, 1926 December 5, 2008), born George Ellis MacDiarmid, was an American conceptual artist and avant-garde composer, as well as a professional chemist who worked as a consultant for companies including Pfizer, Johnson & Johnson, and Mobil Oil.",
"He was a key member of, and influence on, Fluxus, the international group of avant-garde artists centred on George Maciunas, having been involved with the group from the first performances in Wiesbaden 1962 until Maciunas' death in 1978.",
"One of the originators of 'participatory' art, in which the artwork can only be experienced by the active involvement of the viewer, he is most famous for his Event Scores such as Drip Music 1962, and is widely seen as an important precursor to conceptual art."
"He described his own art as a way of 'ensuring that the details of everyday life, the random constellations of objects that surround us, stop going unnoticed.'",
"Steve Joy took me to meet George Brecht in his studio when I was in residence at St Michael's in Manhattan (c.1962). ",
"We became friends and GB mailed instruction cards to me.",
"I brought Steve Joy to St Vincent College when I returned to the monastery from Paris in 1963. GB agreed to provide instructions for an event at St Vincent."
"For his 'Vehicle Sundown Event', GB published a set of about 50 cards to be given to participants who participated in the event with their vehicles.",
"Each card held an instruction to be performed with a vehicle.",
"Drivers were instructed to assemble at sundown in a parking lot and randomly park their vehicles.",
"Then each driver, with a shuffled deck of instructions, would begin performing at the sound of a signal.",
"Participants performed about 50 events such as 'turn on lights', 'start engine', 'stop engine', 'open window'.",
"This work was performed at St Vincent College under the direction of Stephen Joy with Roman Verostko assisting. c. 1963 ( I can confirm that Fr Melvin Ruprecht participated.",
"I believe it was before I went to Washington as NCE editor, rv0"
],
"item" : "00",
"sentences" : []
]

View File

@ -1 +0,0 @@
[('The', 201), ('sound', 134), ('I', 128), ('music', 124), ('work', 74), ('project', 70), ('new', 68), ('record', 67), ('performance', 60), ('This', 59), ('It', 58), ('In', 56), ('graphic', 54), ('also', 52), ('notation', 48), ('art', 48), ("'", 47), ('time', 47), ('DE', 44), ('scores', 44), ('works', 43), ('one', 43), ('event', 42), ('made', 42), ('PLAYER', 41), ('live', 41), ("'s", 41), ('He', 41), ('score', 39), ('artist', 39), (';', 37), ('records', 37), ('Rotterdam', 35), ('Pushing', 35), ('first', 35), ('A', 34), ('For', 33), ('like', 33), ('used', 33), ('artists', 32), ('part', 32), ('would', 32), ('idea', 30), ('use', 30), ('MIDI', 30), ('Scores', 29), ('piece', 29), ('really', 29), ('&', 28), ('analog', 28)]

View File

@ -1,10 +1,4 @@
import sys, os import sys, os
from nltk import word_tokenize
from nltk import everygrams
from nltk import FreqDist
stopws = ['i', 'me', 'my', 'myself', 'we', 'our', 'ours', 'ourselves', 'you', "you're", "you've", "you'll", "you'd", 'your', 'yours', 'yourself', 'yourselves', 'he', 'him', 'his', 'himself', 'she', "she's", 'her', 'hers', 'herself', 'it', "it's", 'its', 'itself', 'they', 'them', 'their', 'theirs', 'themselves', 'what', 'which', 'who', 'whom', 'this', 'that', "that'll", 'these', 'those', 'am', 'is', 'are', 'was', 'were', 'be', 'been', 'being', 'have', 'has', 'had', 'having', 'do', 'does', 'did', 'doing', 'a', 'an', 'the', 'and', 'but', 'if', 'or', 'because', 'as', 'until', 'while', 'of', 'at', 'by', 'for', 'with', 'about', 'against', 'between', 'into', 'through', 'during', 'before', 'after', 'above', 'below', 'to', 'from', 'up', 'down', 'in', 'out', 'on', 'off', 'over', 'under', 'again', 'further', 'then', 'once', 'here', 'there', 'when', 'where', 'why', 'how', 'all', 'any', 'both', 'each', 'few', 'more', 'most', 'other', 'some', 'such', 'no', 'nor', 'not', 'only', 'own', 'same', 'so', 'than', 'too', 'very', 's', 't', 'can', 'will', 'just', 'don', "don't", 'should', "should've", 'now', 'd', 'll', 'm', 'o', 're', 've', 'y', 'ain', 'aren', "aren't", 'couldn', "couldn't", 'didn', "didn't", 'doesn', "doesn't", 'hadn', "hadn't", 'hasn', "hasn't", 'haven', "haven't", 'isn', "isn't", 'ma', 'mightn', "mightn't", 'mustn', "mustn't", 'needn', "needn't", 'shan', "shan't", 'shouldn', "shouldn't", 'wasn', "wasn't", 'weren', "weren't", 'won', "won't", 'wouldn', "wouldn't", ",", ".", "?","!",":","(",")",">","<","@","#","``","/","","''","","-","", "DOCTYPE", "html", "!"]
path = "static/files/" path = "static/files/"
for path, subdirs, files in os.walk(path): for path, subdirs, files in os.walk(path):
@ -12,16 +6,10 @@ for path, subdirs, files in os.walk(path):
if name.endswith('html'): if name.endswith('html'):
file = os.path.join(path, name) file = os.path.join(path, name)
total = open("allhtml.txt", "a") total = open("allhtml.txt", "a")
with open(file, 'r+', encoding='ISO-8859-1') as f: with open(file, 'r') as f:
print(file)
# print(f.readlines())
content = f.read() content = f.read()
print(content)
total.write(content) total.write(content)
total.close() total.close()
with open('allhtml.txt') as f:
content = f.read()
tokens = word_tokenize(content)
tokens = [token for token in tokens if token not in stopws]
freq_file=FreqDist(tokens)
listofwords = open("mostcommon.txt", "w+")
listofwords.write(str(freq_file.most_common(50)))
listofwords.close()

BIN
static/.DS_Store vendored

Binary file not shown.

BIN
static/files/.DS_Store vendored

Binary file not shown.

View File

@ -1,13 +0,0 @@
{
"id": "00",
"name": "Yes",
"email": "sure@whynot.com",
"friend": "Y",
"content": "A sound file.",
"files":[
"files/00/Participants.html",
"files/00/PushingScores.html",
"files/00/events.html"
]
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,11 +0,0 @@
{
"id": "01",
"name": "Yes",
"email": "sure@whynot.com",
"friend": "Y",
"content": "A sound file.",
"files": [
"files/01/01.metadata.html",
"files/01/Photo/TGC1club-web-06 februari 2015-02.jpg"
]
}

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 KiB

Binary file not shown.

View File

@ -1,16 +0,0 @@
{
"id": "02",
"name": "Yes",
"email": "sure@whynot.com",
"friend": "Y",
"content": "A sound file.",
"files": [
"files/02/02.metadata.html",
"files/02/Photo/Scan Manual BACK 300dpi.jpg",
"files/02/Photo/Scan Manual FRONT 300dpi.jpg",
"files/02/Photo/TGC3achterkant.jpg",
"files/02/Photo/TGC3.jpg",
"files/02/Photo/TGC3 top.jpg",
"files/02/Photo/TGC3voorkant.jpg"
]
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 999 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

View File

@ -1,11 +0,0 @@
{
"id": "03",
"name": "Yes",
"email": "sure@whynot.com",
"friend": "Y",
"content": "A sound file.",
"files": [
"files/03/03.metadata.html",
"files/03/Photo/Kris princ2-s-2000px-72dpi-79 02 juli 2015.jpg"
]
}

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 963 KiB

View File

@ -1,5 +0,0 @@
Here is a description of the event / artist / work.
For the event, it can describe what happened, where it happened, when it happened.
For the artist, it can introduce the artist.
For the work, it can describe the content.

View File

@ -1 +0,0 @@
Why was the artist / piece / event included in the collection.

View File

@ -1 +0,0 @@
Here you can go into length about an artists practice. For example, interviews, personal statements, reviews etc.

Binary file not shown.

View File

@ -1,16 +0,0 @@
{
"id": "05",
"name": "Yes",
"email": "sure@whynot.com",
"friend": "Y",
"content": "A sound file.",
"files": [
"files/05/05.metadata.html",
"files/05/Sound/DOB079_VaastColson_CarlsonInvents.mp3",
"files/05/Photo/DOB079-Vaast-Colson-spread-1600px-web-160913-1.jpg",
"files/05/Photo/DOB079-Vaast-Colson-1600px-web-160913-11.jpg",
"files/05/Photo/ArtBookFairBrussel-Vaast Colson-6d-20160909-57-20.jpg",
"files/05/Photo/DOB079-Vaast-Colson-1600px-web-160913-10.jpg",
"files/05/Photo/VaastColson.jpg"
]
}

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 390 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 340 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 346 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Binary file not shown.

View File

@ -1,12 +0,0 @@
{
"id": "17",
"Who": "George Brecht",
"What": "Works",
"content": "A sound file.",
"files": [
"files/17/17.blurb.html",
"files/17/Photo/brecht-event1.jpg",
"files/17/Photo/svc-1966-brecht's sundown event-i.jpg",
"files/17/Video/Drip Music - George Brecht (Fluxus)-UT5lgaE-qZY.mkv"
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

View File

@ -14,6 +14,6 @@
{% block index %} {% block index %}
{% for each in index_dict %} {% for each in index_dict %}
{% set address = "/description?id=" + each %} {% set address = "/description?id=" + each %}
<a href={{address}}>{{index_dict[each]}}</a> <a href={{address}}>{{index_dict[each]}}</a> |
{% endfor %} {% endfor %}
{% endblock index %} {% endblock index %}

View File

@ -1,9 +1,9 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title><a href="">P.u.s.h.i.n.g.S.c.o.r.e.s</a></title> <title>P.u.s.h.i.n.g.S.c.o.r.e.s</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">
</head> </head>
<body> <body>

View File

@ -18,7 +18,7 @@ for path, subdirs, files in os.walk(path):
if name.endswith('html'): if name.endswith('html'):
file = os.path.join(path, name) file = os.path.join(path, name)
total = open("allhtml.txt", "a") total = open("allhtml.txt", "a")
with open(file, 'r+', encoding='ISO-8859-1') as f: with open(file, 'r+') as f:
content = f.read() content = f.read()
total.write(content) total.write(content)
total.close() total.close()
@ -47,21 +47,21 @@ sentences_w_word = {}
def analysis(the_word, file_name): def analysis(the_word, file_name):
id = file_name[13:15] id = file_name[13:15]
with open(file_name, 'r+', encoding='ISO-8859-1') as f: with open(file_name, 'r+') as f:
content = f.read() content = f.read()
sent_tokens = sent_tokenize(content) sent_tokens = sent_tokenize(content)
new_sent_tokens = [] new_sent_tokens = []
for sent_token in sent_tokens: for sent_token in sent_tokens:
if the_word in sent_token: if the_word in sent_token:
new_sent_tokens.append({'id': id, 'sentence': sent_token.replace('\n', ' ').strip("'<>()")}) new_sent_tokens.append({'id': id, 'sentence': sent_token.replace('\n', ' ').strip("'<>()“”")})
if the_word in sentences_w_word: # if this is not the first iteration if the_word in sentences_w_word: # if this is not the first iteration
previous_sent_tokens = sentences_w_word[the_word] previous_sent_tokens = sentences_w_word[the_word]
full_sent_tokens = previous_sent_tokens + new_sent_tokens full_sent_tokens = previous_sent_tokens + new_sent_tokens
else: else:
full_sent_tokens = new_sent_tokens full_sent_tokens = new_sent_tokens
sentences_w_word[word] = full_sent_tokens sentences_w_word[the_word] = full_sent_tokens
# maybe ISO-8859-1 instead of utf8??
path = "static/files/" path = "static/files/"
for path, subdirs, files in os.walk(path): for path, subdirs, files in os.walk(path):
@ -71,5 +71,5 @@ for path, subdirs, files in os.walk(path):
for word in keyword_list: for word in keyword_list:
analysis(word, file) analysis(word, file)
with open('wordlist.json', 'w', encoding="utf8") as outfile: with open('wordlist.json', 'w') as outfile:
json.dump(sentences_w_word, outfile, ensure_ascii=False) json.dump(sentences_w_word, outfile, ensure_ascii=False)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,37 +0,0 @@
{
"way" : [
{
"id" : "17",
"sentence" : "He described his own art as a way of 'ensuring that the details of everyday life, the random constellations of objects that surround us, stop going unnoticed.'"
},
{
"id" : "17",
"sentence" : "Another sentence like way way this."
},
{
"id" : "00",
"sentence" : "Our ambition, and that of our collaborating partners, is to emancipate graphic notation from the confines of the modernist tradition, in such a way that it may remain an innovative and provocative medium for decades to come."
}
],
"artwork" : [
{
"id" : "17",
"sentence" : "One of the originators of 'participatory' art, in which the artwork can only be experienced by the active involvement of the viewer, he is most famous for his Event Scores such as Drip Music 1962, and is widely seen as an important precursor to conceptual art."
},
{
"id" : "00",
"sentence" : "It unfolds through a nomadic program which includes the creation of newly commissioned artworks and public events that addres scontemporary questions and issues in this particular field."
},
{
"id" : "00",
"sentence" : "The discursive program for 20162017 will include lectures, presentations of newly commissioned artworks, concert evenings, and workshops."
}
]
}

View File

@ -1,7 +0,0 @@
text = open('static/files/17. George Brecht_event scores/17.blurb.txt')
search_words = ['random', 'composer', 'iron', 'car']
for line in text:
if any(word in line for word in search_words):