@Test public void testContinueAfterStartAndNotSameType() { final String outcome = CONTINUE_B; String[] inputSequence = new String[] {"PersonA", "LocationA", "something"}; String[] outcomesSequence = new String[] {START_A}; Assert.assertFalse(validator.validSequence(1, inputSequence, outcomesSequence, outcome)); }
public boolean validSequence(int i, String[] inputSequence, String[] outcomesSequence, String outcome) { if (outcome.endsWith(BioCodec.CONTINUE)) { int li = outcomesSequence.length - 1; if (li == -1) { return false; } else if (outcomesSequence[li].endsWith(BioCodec.OTHER)) { return false; } else if (outcomesSequence[li].endsWith(BioCodec.CONTINUE) || outcomesSequence[li].endsWith(BioCodec.START)) { String previousNameType = NameFinderME.extractNameType(outcomesSequence[li]); String nameType = NameFinderME.extractNameType(outcome); if (previousNameType != null || nameType != null ) { if (nameType != null ) { if (nameType.equals(previousNameType)) { return true; } } return false; } } } return true; }
NameFinderSequenceValidator implements
    SequenceValidator<String> { public boolean validSequence(int i, String[] inputSequence, String[] outcomesSequence, String outcome) { if (outcome.endsWith(BioCodec.CONTINUE)) { int li = outcomesSequence.length - 1; if (li == -1) { return false; } else if (outcomesSequence[li].endsWith(BioCodec.OTHER)) { return false; } else if (outcomesSequence[li].endsWith(BioCodec.CONTINUE) || outcomesSequence[li].endsWith(BioCodec.START)) { String previousNameType = NameFinderME.extractNameType(outcomesSequence[li]); String nameType = NameFinderME.extractNameType(outcome); if (previousNameType != null || nameType != null ) { if (nameType != null ) { if (nameType.equals(previousNameType)) { return true; } } return false; } } } return true; } }
NameFinderSequenceValidator implements
    SequenceValidator<String> { public boolean validSequence(int i, String[] inputSequence, String[] outcomesSequence, String outcome) { if (outcome.endsWith(BioCodec.CONTINUE)) { int li = outcomesSequence.length - 1; if (li == -1) { return false; } else if (outcomesSequence[li].endsWith(BioCodec.OTHER)) { return false; } else if (outcomesSequence[li].endsWith(BioCodec.CONTINUE) || outcomesSequence[li].endsWith(BioCodec.START)) { String previousNameType = NameFinderME.extractNameType(outcomesSequence[li]); String nameType = NameFinderME.extractNameType(outcome); if (previousNameType != null || nameType != null ) { if (nameType != null ) { if (nameType.equals(previousNameType)) { return true; } } return false; } } } return true; }  }
NameFinderSequenceValidator implements
    SequenceValidator<String> { public boolean validSequence(int i, String[] inputSequence, String[] outcomesSequence, String outcome) { if (outcome.endsWith(BioCodec.CONTINUE)) { int li = outcomesSequence.length - 1; if (li == -1) { return false; } else if (outcomesSequence[li].endsWith(BioCodec.OTHER)) { return false; } else if (outcomesSequence[li].endsWith(BioCodec.CONTINUE) || outcomesSequence[li].endsWith(BioCodec.START)) { String previousNameType = NameFinderME.extractNameType(outcomesSequence[li]); String nameType = NameFinderME.extractNameType(outcome); if (previousNameType != null || nameType != null ) { if (nameType != null ) { if (nameType.equals(previousNameType)) { return true; } } return false; } } } return true; }  boolean validSequence(int i, String[] inputSequence,
      String[] outcomesSequence, String outcome); }
NameFinderSequenceValidator implements
    SequenceValidator<String> { public boolean validSequence(int i, String[] inputSequence, String[] outcomesSequence, String outcome) { if (outcome.endsWith(BioCodec.CONTINUE)) { int li = outcomesSequence.length - 1; if (li == -1) { return false; } else if (outcomesSequence[li].endsWith(BioCodec.OTHER)) { return false; } else if (outcomesSequence[li].endsWith(BioCodec.CONTINUE) || outcomesSequence[li].endsWith(BioCodec.START)) { String previousNameType = NameFinderME.extractNameType(outcomesSequence[li]); String nameType = NameFinderME.extractNameType(outcome); if (previousNameType != null || nameType != null ) { if (nameType != null ) { if (nameType.equals(previousNameType)) { return true; } } return false; } } } return true; }  boolean validSequence(int i, String[] inputSequence,
      String[] outcomesSequence, String outcome);  }