@@ -0,0 +1,2186 @@
+package GenERRate;%0A%0Aimport junit.framework.TestCase;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0Aimport java.util.regex.Matcher;%0Aimport java.util.regex.Pattern;%0A%0A/**%0A * Created by ndronen on 8/31/15.%0A */%0Apublic class DeletionWordErrorTest extends TestCase %7B%0A    public void testInsertError() throws CannotCreateErrorException %7B%0A        boolean isTagged = true;%0A        Sentence sentence = new Sentence(%22I PRP grew VBD up RP with IN a DT %22 +%0A                %22mentally RB ill JJ single JJ mother NN raising VBG me PRP %22 +%0A                %22and CC no DT father NN figure NN in IN my PRP$ life NN . .%22,%0A                isTagged);%0A        Map%3CString, Integer%3E expectations = new HashMap%3CString, Integer%3E();%0A        expectations.put(%22with%22, 4);%0A        expectations.put(%22in%22, 16);%0A%0A        for (Map.Entry%3CString, Integer%3E entry : expectations.entrySet()) %7B%0A            DeletionWordError error = new DeletionWordError(sentence, entry.getKey());%0A            Sentence corruptSentence = error.insertError();%0A            // Expecting the error to be position 4.%0A            DeletionDescription description = new DeletionDescription(corruptSentence.getErrorDescription());%0A            assertEquals((int) entry.getValue(), description.getPosition());%0A            assertEquals(entry.getKey(), description.getToken());%0A        %7D%0A    %7D%0A%0A    private class DeletionDescription %7B%0A        private final String token;%0A        private final int position;%0A%0A        private final String regex = %22errortype=%5C%22DeletionError%5C%22 details=%5C%22(.*) at (.*)%5C%22%22;%0A        private final Pattern pattern = Pattern.compile(regex);%0A%0A        public DeletionDescription(String errorDescription) %7B%0A            System.out.println(errorDescription);%0A            Matcher matcher = pattern.matcher(errorDescription);%0A            if (!matcher.matches()) %7B%0A                throw new RuntimeException(%22Not a DeletionError description : %22 + errorDescription);%0A            %7D%0A            token = matcher.group(1);%0A            position = Integer.valueOf(matcher.group(2));%0A        %7D%0A%0A        public String getToken() %7B%0A            return token;%0A        %7D%0A%0A        public int getPosition() %7B%0A            return position;%0A        %7D%0A    %7D%0A%7D

Add DeletionWordErrorTest.