Beispiel #1
0
 /* (non-Javadoc)
  * @see iitb.Model.FeatureTypes#startScanFeaturesAt(iitb.CRF.DataSequence, int)
  * all windows that overlap with this position
  *
  */
 private void assignBoundaryInt(BFeatureImpl feature, int pos) {
   Window w = windows[currentWindow];
   if (w.startRelativeToLeft && w.endRelativeToLeft) {
     // TODO -- handle this case. for each value between w.start..w.end generate a different
     // feature
     assert (pos - w.start == pos - w.end);
     feature._startB = pos - w.start;
     feature._endB = feature._startB + w.minLength - 1;
     feature._startOpen = false;
     feature._endOpen = (w.maxLength == Integer.MAX_VALUE);
   } else if (w.startRelativeToLeft && !w.endRelativeToLeft) {
     feature._startB = pos - w.start;
     feature._endB = pos - w.end;
     feature._startOpen = (w.maxLength == Integer.MAX_VALUE);
     feature._endOpen = (w.maxLength == Integer.MAX_VALUE);
   } else if (!w.startRelativeToLeft && !w.endRelativeToLeft) {
     assert (pos - w.start == pos - w.end);
     feature._endB = pos - w.end;
     feature._startB = feature._endB - w.minLength + 1;
     feature._startOpen = (w.maxLength == Integer.MAX_VALUE);
     feature._endOpen = false;
   } else assert (false); // invalid combination
 }
 private boolean nextFeatureNew() {
   Window twindow = windows[currWin];
   currBdry++;
   if (currBdry <= cfRange.end) {
     switch (getWindowType(twindow)) {
       case WIN_LEFT:
         fboundary._startB = currBdry;
         fboundary._endB = fboundary._startB + minWinLength - 1;
         break;
       case WIN_RIGHT:
         fboundary._endB = currBdry;
         fboundary._startB = fboundary._endB - minWinLength + 1;
         break;
       case WIN_MIDDLE:
         fboundary._startB = currBdry;
         fboundary._endB = fboundary._startB + maxGap - 1;
         break;
     }
     return true;
   } else {
     featureValid = false;
     return false;
   }
 }