Changeset 1650
- Timestamp:
- 08/04/14 17:27:03 (10 years ago)
- Location:
- branches
- Files:
-
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/autoquest-core-tasktrees-alignment-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/NumberSequenceTest.java
r1649 r1650 14 14 } 15 15 16 int[] pat1 = new int[]{2,3,4};17 int[] pat2 = new int[]{2,3,4};16 int[] pat1 = new int[]{2,3,4}; 17 int[] pat2 = new int[]{2,3,4}; 18 18 19 int[] pat3 = new int[]{5,-1,7};20 int[] pat4 = new int[]{1,2,3};19 int[] pat3 = new int[]{5,-1,6}; 20 int[] pat4 = new int[]{1,2,3}; 21 21 22 int[] pat5 = new int[]{-1,-1,-1};22 int[] pat5 = new int[]{-1,-1,-1}; 23 23 24 int[] pat6 = new int[]{10,11,12};24 int[] pat6 = new int[]{10,11,12}; 25 25 26 int[] pat7 = new int[]{8,9,10};27 int[] pat8 = new int[]{7,6,5};26 int[] pat7 = new int[]{8,9,10}; 27 int[] pat8 = new int[]{7,6,5}; 28 28 29 int[] pat9 = new int[]{0};29 int[] pat9 = new int[]{0}; 30 30 int[] pat10 = new int[]{1}; 31 32 int[] pat11 = new int[]{5,-1,-1,6}; 33 int[] pat12 = new int[]{10,12,12,12}; 31 34 32 35 … … 49 52 50 53 assertEquals(Integer.valueOf(1),ns.containsPattern(pattern).get(0)); 54 assertEquals(2,ns.containsPattern(pattern).size()); 51 55 assertEquals(Integer.valueOf(5),ns.containsPattern(pattern).get(1)); 52 assertEquals(2,ns.containsPattern(pattern).size());56 53 57 54 58 firstpattern.setSequence(pat5); … … 69 73 assertEquals(Integer.valueOf(1),ns.containsPattern(pattern).get(1)); 70 74 assertEquals(2,ns.containsPattern(pattern).size()); 75 76 firstpattern.setSequence(pat11); 77 secondpattern.setSequence(pat12); 78 assertEquals(1,ns.containsPattern(pattern).size()); 79 assertEquals(Integer.valueOf(5),ns.containsPattern(pattern).get(0)); 80 71 81 72 82 } -
branches/autoquest-core-tasktrees-alignment-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleAlignmentTest.java
r1649 r1650 20 20 * @author Patrick Harms 21 21 */ 22 public class SequenceForTaskDetectionRule Test extends AbstractTemporalRelationshipTC {22 public class SequenceForTaskDetectionRuleAlignmentTest extends AbstractTemporalRelationshipTC { 23 23 24 24 /** -
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/NumberSequence.java
r1648 r1650 48 48 } 49 49 50 //Searching occur ences of50 //Searching occurrences of 51 51 public LinkedList<Integer> containsPattern(Match pattern) { 52 52 LinkedList<Integer> result = new LinkedList<Integer>(); … … 58 58 int ipat1 =0; 59 59 int ipat2 =0; 60 int optcount1 = 0; 61 int optcount2 = 0; 60 62 while(ipat1 < pat1.length && ipat2<pat2.length) { 61 63 if(pat1[ipat1]==-1) { 62 64 ipat1++; 65 optcount1++; 63 66 continue; 64 67 } 65 68 if(pat2[ipat2]==-1) { 66 69 ipat2++; 70 optcount2++; 67 71 continue; 68 72 } 69 if (sequence[i + ipat1 ] != pat1[ipat1]70 && sequence[i + ipat2 ] != pat2[ipat2]) {73 if (sequence[i + ipat1-optcount1] != pat1[ipat1] 74 && sequence[i + ipat2-optcount2] != pat2[ipat2]) { 71 75 i++; 76 //System.out.println(sequence[i+ipat1] + " != " + pat1[ipat1] + " || " + sequence[i+ipat2] + " != " + pat2[ipat2]); 72 77 continue notmatched; 73 78 } -
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleAlignment.java
r1649 r1650 206 206 .hasNext();) { 207 207 int start = jt.next(); 208 System.out.println("Found match ");209 pattern.getFirstSequence().printSequence();210 pattern.getSecondSequence().printSequence();211 System.out.println("in sequence " + (j+1) + " at position " + start);208 //System.out.println("Found match "); 209 //pattern.getFirstSequence().printSequence(); 210 //pattern.getSecondSequence().printSequence(); 211 //System.out.println("in sequence " + (j+1) + " at position " + start); 212 212 pattern.addOccurence( 213 213 new MatchOccurence(start, j));
Note: See TracChangeset
for help on using the changeset viewer.