Commit 4258ac85 authored by Maria Barbatei's avatar Maria Barbatei

extracting ICD Codes aus der Diagnose

parent 4191dd19
Pipeline #2487 skipped
......@@ -11,6 +11,7 @@ import java.util.regex.Pattern;
public class AbsatzSplitter {
public static final String PATH = "/Users/mariabarbatei/Desktop/Arztbrief1.txt";
private static final Object DIAGNOSE = "Diagnose:";
public static void main(String[] args) throws IOException {
......@@ -48,10 +49,13 @@ public class AbsatzSplitter {
Map<String, String> map = new HashMap<String, String>();
while (m1.find() && m2.find()) {
System.out.println("Key: " + m1.group());
System.out.println("Value: " + m2.group());
map.put(m1.group(), m2.group());
//System.out.println("Key: " + m1.group());
//System.out.println("Value: " + m2.group());
if(m1.group().equals(DIAGNOSE)) {
map.put(m1.group(), m2.group().replaceAll("\\{[^{}]*\\}", ""));
} else {
map.put(m1.group(), m2.group());
}
}
for(Map.Entry<String, String> entry : map.entrySet()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment