[go: nahoru, domu]

Skip to content

Commit

Permalink
chor: backup
Browse files Browse the repository at this point in the history
  • Loading branch information
KeremDUZENLI committed Apr 12, 2024
1 parent bbf521f commit d2ded3c
Show file tree
Hide file tree
Showing 16 changed files with 81 additions and 23 deletions.
47 changes: 24 additions & 23 deletions main_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,33 @@ def __init__(self, top_frequency=5, languages=None, action_type=None, output_typ
setup.set_input_files(self)
setup.set_output_folders(self)
setup.set_output_files(self)
setup.set_dictionaries(self)

self.set_dictionaries()

self.create_common_and_frequent_words()

def set_dictionaries(self):
load_mock = LoadMock
self.all_websites_frequent_words_dict = []
self.all_websites_frequent_words_dict_translated_de = []
self.all_websites_frequent_words_dict_translated_en = []
self.all_websites_url = []

runs_types = {
"mock_commons": load_mock.load_commons_mock,
"mock_frequency": load_mock.load_frequency_mock,

"read_txt": read_frequent_words_from_txt,

"read_websites": create_frequent_words_from_example,
"read_excel": create_frequent_words_from_excel,

None: lambda x: None
}

runs_types.get(self.run_type)(self)
save_frequent_words_dict_as_txt(self)

def create_common_and_frequent_words(self):
if self.action_type in ["COMMON_WORDS", "BOTH"]:
self.create_common_words()
Expand Down Expand Up @@ -162,25 +185,3 @@ def set_output_files(self):
"all_websites_frequent_words_dict_translated_de.xlsx"
self.all_websites_frequent_words_dict_translated_xlsx_en = self.directory_output_frequent_xls +\
"all_websites_frequent_words_dict_translated_en.xlsx"

def set_dictionaries(self):
load_mock = LoadMock
self.all_websites_frequent_words_dict = []
self.all_websites_frequent_words_dict_translated_de = []
self.all_websites_frequent_words_dict_translated_en = []
self.all_websites_url = []

runs_types = {
"mock_commons": load_mock.load_commons_mock,
"mock_frequency": load_mock.load_frequency_mock,

"read_txt": read_frequent_words_from_txt,

"read_websites": create_frequent_words_from_example,
"read_excel": create_frequent_words_from_excel,

None: lambda x: None
}

runs_types.get(self.run_type)(self)
save_frequent_words_dict_as_txt(self)
1 change: 1 addition & 0 deletions output/all_websites_frequent_words_dict.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{'WEB Adress': 'https://www.fuckhead.at/', 'Top Words': [('Immer', 6)]}, {'WEB Adress': 'http://www.interstellarrecords.at/index.php', 'Top Words': [('Interstellar', 54)]}, {'WEB Adress': 'https://kuprosauwald.org/', 'Top Words': [('Obernberg', 11)]}, {'WEB Adress': 'https://r�da.at/der-verein/', 'Top Words': [('Technische', 7)]}, {'WEB Adress': 'http://www.grgr.at/', 'Top Words': [('Gregor', 20)]}]
1 change: 1 addition & 0 deletions output/all_websites_frequent_words_dict_translated_de.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{'WEB Adress': 'https://www.fuckhead.at/', 'Top Words': [('Immer', 6)]}, {'WEB Adress': 'http://www.interstellarrecords.at/index.php', 'Top Words': [('Interstellar', 54)]}, {'WEB Adress': 'https://kuprosauwald.org/', 'Top Words': [('Obernberg', 11)]}, {'WEB Adress': 'https://r�da.at/der-verein/', 'Top Words': [('Technische', 7)]}, {'WEB Adress': 'http://www.grgr.at/', 'Top Words': [('Gregor', 20)]}]
1 change: 1 addition & 0 deletions output/all_websites_frequent_words_dict_translated_en.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{'WEB Adress': 'https://www.fuckhead.at/', 'Top Words': [('Always', 6)]}, {'WEB Adress': 'http://www.interstellarrecords.at/index.php', 'Top Words': [('Interstellar', 54)]}, {'WEB Adress': 'https://kuprosauwald.org/', 'Top Words': [('Obernberg', 11)]}, {'WEB Adress': 'https://r�da.at/der-verein/', 'Top Words': [('Technical', 7)]}, {'WEB Adress': 'http://www.grgr.at/', 'Top Words': [('Gregory', 20)]}]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Common Word,Total Frequency,Websites
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Common Word,Total Frequency,Websites
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Common Word,Total Frequency,Websites
Binary file not shown.
Binary file not shown.
Binary file not shown.
17 changes: 17 additions & 0 deletions output/frequent_words/csv/all_websites_frequent_words_dict.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Most Frequent Words,Frequency

https://www.fuckhead.at/
Immer,6

http://www.interstellarrecords.at/index.php
Interstellar,54

https://kuprosauwald.org/
Obernberg,11

https://röda.at/der-verein/
Technische,7

http://www.grgr.at/
Gregor,20

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Most Frequent Words,Frequency

https://www.fuckhead.at/
Immer,6

http://www.interstellarrecords.at/index.php
Interstellar,54

https://kuprosauwald.org/
Obernberg,11

https://röda.at/der-verein/
Technische,7

http://www.grgr.at/
Gregor,20

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Most Frequent Words,Frequency

https://www.fuckhead.at/
Always,6

http://www.interstellarrecords.at/index.php
Interstellar,54

https://kuprosauwald.org/
Obernberg,11

https://röda.at/der-verein/
Technical,7

http://www.grgr.at/
Gregory,20

Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit d2ded3c

Please sign in to comment.