Skip to content
Snippets Groups Projects
Commit 9fb51e9a authored by Tomasz Naskret's avatar Tomasz Naskret
Browse files

skeleton for impl

parent 70a74e27
Branches clarinjson
No related tags found
No related merge requests found
......@@ -157,6 +157,7 @@ public class CorpusReader {
xmlReader = inputFactory.createXMLEventReader(xmlPosReader);
}
//TODO Format checking extract to separate file
public void checkFormat() {
try {
if (currentFile.getName().toLowerCase().endsWith(".tgt")) format = INTERNAL_FORMAT;
......@@ -166,6 +167,7 @@ public class CorpusReader {
else if (checkFormatXCES()) format = XCES_FORMAT;
else if (checkFormatTEI()) format = TEI_FORMAT;
else if (checkFormatCCL()) format = XCES_FORMAT;
else if (checkFormatJson()) format = JSON_FORMAT;
else format = UNKNOWN_FORMAT;
} catch (IOException e) {
e.printStackTrace();
......@@ -173,6 +175,11 @@ public class CorpusReader {
}
}
//TODO Implement correct check
private boolean checkFormatJson() {
return true;
}
public boolean checkFormatTXT() throws IOException {
String line;
boolean ok = true;
......@@ -272,12 +279,20 @@ public class CorpusReader {
case CONLLU_FORMAT:
current = getTokenFromCONLLUFile();
break;
case JSON_FORMAT:
current = getTokenFromJsonFile();
break;
default:
current = null;
}
return current;
}
//TODO Implement token reder
private Token getTokenFromJsonFile() {
return new Token();
}
public Token getTokenFromTGTFile() {
String line;
......
......@@ -6,5 +6,6 @@ public enum FileFormat {
XCES_FORMAT,
TEI_FORMAT,
CONLLU_FORMAT,
JSON_FORMAT,
INTERNAL_FORMAT
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment