You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
603 B
19 lines
603 B
import configparser, importlib.machinery
|
|
from cppy.cp_util import *
|
|
|
|
def load_plugins():
|
|
config = configparser.ConfigParser()
|
|
script_dir = os.path.dirname(os.path.abspath(__file__))
|
|
os.chdir(script_dir)
|
|
config.read("config.ini")
|
|
frequencies_plugin = config.get("Plugins", "frequencies")
|
|
|
|
global get_frequencies
|
|
get_frequencies = importlib.machinery.SourcelessFileLoader('tffreqs', frequencies_plugin).load_module()
|
|
|
|
|
|
load_plugins()
|
|
|
|
wordlist = extract_file_words( testfilepath )
|
|
word_freqs = get_frequencies.top_word( wordlist )
|
|
print_word_freqs(word_freqs) |