Initial commit

This commit is contained in:
Stephan Porada
2019-02-28 14:09:53 +01:00
commit 96e84d083d
97 changed files with 66293 additions and 0 deletions

9620
app/utils/classes.txt Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,36 @@
"""
Small script creating the models for the N-Gramm Viewer holding containing all
the different n-gramm data.
"""
corpus_type_list = ["lm_ns_year", "tk_ws_year", "lm_ns_speaker", "tk_ws_speaker"]
sort_key_list = ([i for i in range(10)]
+ "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z".split()
+ ["_Non_ASCII"])
ngram_kinds = ["One", "Two", "Three", "Four", "Five"]
template_class = """
class Key{}_{}Gram_{}(models.Model):
ngram = models.CharField(verbose_name='{}Gram',
max_length=255,
default=None,
null=True,
blank=True)
key = models.CharField(max_length=255)
count = models.IntegerField()
def __str__(self):
return str(self.ngram) + " " + str(self.key)
"""
classes = []
for corpus_type in corpus_type_list:
for ngram_kind in ngram_kinds:
for key in sort_key_list:
cls = template_class.format(key, ngram_kind, corpus_type,
ngram_kind)
classes.append(cls)
with open("classes.txt", "w") as file:
for cls in classes:
file.write("{}\n".format(cls))