Merge function finished! v0.0.2-6

This commit is contained in:
minimo-io 2022-10-28 19:41:40 -03:00
parent bfe6fa3b59
commit bdf7bd93d4
4 changed files with 3167 additions and 1575 deletions

View File

@ -107,13 +107,37 @@ main(List<String> args) async {
String input1 = await File(parserResults["input1"]).readAsString();
String input2 = await File(parserResults["input2"]).readAsString();
var json1 = jsonDecode(input1);
List json1 = jsonDecode(input1);
List json2 = jsonDecode(input2);
print("Json 1 total word wount:" + json1.length.toString());
print("Json 2 total word wount:" + json2.length.toString());
print(json1);
int sameWordsCount = 0;
List<Map<String, dynamic>> finalList = [];
for (var i = 0; i < json1.length; i++) {
bool isDuplicated = false;
// check on json2 strings
for (var ii = 0; ii < json2.length; ii++) {
if (json1[i]["t"] == json2[ii]["t"]) {
// if exists in both remove from the second file before merge
json2.remove(json2[ii]);
// File(parserResults["input1"]).readAsString().then((String contents) {
sameWordsCount++;
break;
}
}
finalList = [...json1, ...json2];
// if (isDuplicated == true) {
// finalList.add(json1[i]);
// print(json1[i]["t"]);
// }
}
// });
print("Ché, there is a total of $sameWordsCount duplicated words.");
print("Total words for new file: " + (finalList.length.toString()));
// return map['users'];
saveFile(json.encode(finalList), parserResults["output"]);
}
// last dicc from folkloretradiciones.com.ar
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -29,8 +29,8 @@ const App = Vue.createApp({
async mounted(){
// const res = await fetch("https://cdn.jsdelivr.net/gh/minimo-io/appticles@v0.0.2-6/mo-lunfardo/data/lunfardo-dict-es.json");
// const res = await fetch("tools/dicc.json");
const res = await fetch("data/lunfardo-dict-es.json");
//const res = await fetch("data/dicc-merged.json");
const res = await fetch("dart_tools/data/lunfardo-dict-es.json");
this.wordsJson = await res.json();
},