nec files added

This commit is contained in:
Helio 2022-04-19 14:42:29 +02:00
parent a10a669e22
commit 0a0943b223
6 changed files with 43 additions and 0 deletions

View file

@ -17,6 +17,7 @@ namespace cce {
bool saved = false;
byte reset = 0;
while (true) {
Title = Title + " >>> Settings";
Clear();
AppSettings.Screen(saved, reset);
ConsoleKeyInfo cki;
@ -126,6 +127,7 @@ Press [Backspace] to return to main menu");
Settings = DefaultSettings.Settings;
}
static private byte AreYouSure() {
Title = "Are You Sure?";
SetCursorPosition(0, top_bottom.Item1);
WriteLine(@"

View file

@ -17,6 +17,7 @@ namespace cce {
byte choice = 255;
AppSettings.Update();
while (true) {
Title = title;
SetBufferSize(240, 60);
SetWindowSize(120, 30);
Clear();

View file

@ -265,6 +265,14 @@ namespace cce {
}
File.WriteAllText(output, JsonConvert.SerializeObject(vals));
}
static internal void concat() {
init();
var dict = new Dictionary<string, Dictionary<string, string>>();
dict.Add("short", common_dict);
dict.Add("long", extended_dict);
File.WriteAllText("dictionary.json", JsonConvert.SerializeObject(dict));
}
static private void wordwrite(Dictionary<string, string> collection, string decode, string entry,int left, int i) {
foreach (var item in collection) {
if (item.Value == decode) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,30 @@
import nltk
from nltk.corpus import brown
import json
comm = open("common_dict.json", "r")
common_data = json.load(comm)
comm.close()
ext = open("extended_dict.json", "r")
ext_data = json.load(ext)
ext.close()
common_array = []
extended_array = []
for k in common_data:
common_array.append(k)
for k in ext_data:
extended_array.append(k)
freqs = nltk.FreqDist([w.lower() for w in brown.words()])
common_sorted = sorted(common_array, key=lambda x: freqs[x.lower()], reverse=True)
extended_sorted = sorted(extended_array, key=lambda x: freqs[x.lower()], reverse=True)
file = open("common_dict.txt", "w")
file.write('\n'.join(str(line) for line in common_sorted))
file = open("extended_dict.txt", "w")
file.write('\n'.join(str(line) for line in extended_sorted))
file.close()