TSJ and TSV parsing (#1962)

* Deserialization support for tsv files

* Benchmarking

* Apparently moving the setter out of the lambda fixed the setAccessible issue

* Thread it

* Use AllArgsConstructor instead of field reflection

* Clean up AllArgsConstructor TSV deserialization

* Refactor TsvUtils

* Remove AllArgsConstructors from Excels

* Set field accessible

* [WIP] TSJ improvements

* [WIP] More TSV stuff

* [WIP] More TSV stuff

* Working TSV parser (slow)

* Load Excels in TSJ > JSON > TSV priority
This commit is contained in:
Luke H-W
2022-11-24 00:18:57 +10:30
committed by GitHub
parent 46b0c7cf93
commit 0b5329514b
16 changed files with 755 additions and 66 deletions

View File

@@ -395,4 +395,22 @@ public final class Utils {
public static <T> T drawRandomListElement(List<T> list) {
return drawRandomListElement(list, null);
}
/***
* Splits a string by a character, into a list
* @param input The string to split
* @param separator The character to use as the split points
* @return A list of all the substrings
*/
public static List<String> nonRegexSplit(String input, int separator) {
var output = new ArrayList<String>();
int start = 0;
for (int next = input.indexOf(separator); next > 0; next = input.indexOf(separator, start)) {
output.add(input.substring(start, next));
start = next + 1;
}
if (start < input.length())
output.add(input.substring(start));
return output;
}
}