private void initFeatureOpenFlag(Window twindow, BFeatureImpl tfeatureImpl) {
   switch (getWindowType(twindow)) {
     case WIN_LEFT:
       tfeatureImpl._startOpen = false;
       tfeatureImpl._endOpen = (twindow.maxLength == Integer.MAX_VALUE);
       break;
     case WIN_RIGHT:
       tfeatureImpl._startOpen = (twindow.maxLength == Integer.MAX_VALUE);
       tfeatureImpl._endOpen = false;
       break;
     case WIN_MIDDLE:
       tfeatureImpl._startOpen = twindow.maxLength == Integer.MAX_VALUE;
       tfeatureImpl._endOpen = twindow.maxLength == Integer.MAX_VALUE;
       break;
     default:
       assert (false);
   }
 }
Beispiel #2
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
 }