net.sf.okapi.common.Event.getStartGroup()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(108)

本文整理了Java中net.sf.okapi.common.Event.getStartGroup()方法的一些代码示例,展示了Event.getStartGroup()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.getStartGroup()方法的具体详情如下:
包路径:net.sf.okapi.common.Event
类名称:Event
方法名:getStartGroup

Event.getStartGroup介绍

[英]Convenience method returns the IResource as a StartGroup. The caller should confirm the Event type using isStartGroup before calling this method.
[中]便利方法将IResource作为StartGroup返回。调用方应在调用此方法之前使用isStartGroup确认事件类型。

代码示例

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-idml

private void handleStartGroupEvent(Event event) {
  ReferenceableEvent parentReferenceableEvent = findParentReferenceableEvent(event.getStartGroup().getParentId());
  ReferenceableEvent referentEvent = new ReferenceableEvent(event.getStartGroup().getId(), event);
  parentReferenceableEvent.addReferentEvent(referentEvent);
  parentReferenceableEvents.push(referentEvent);
}

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-idml

private boolean addReferenceableContent(TextFragment textFragment, StoryChildElement.StyledTextElement.StyledTextReferenceElement styledTextReferenceElement,
                    String parentId, int inlineReferenceOpeningDepth) throws XMLStreamException {
  if (styledTextReferenceElement instanceof StoryChildElement.StyledTextReferenceElement.HyperlinkTextSource) {
    return addHyperlinkTextSource(textFragment, styledTextReferenceElement, inlineReferenceOpeningDepth);
  }
  if (styledTextReferenceElement instanceof StoryChildElement.StyledTextElement.StyledTextReferenceElement.Note && !parameters.getExtractNotes()) {
    addIsolatedCode(textFragment, styledTextReferenceElement);
    return false;
  }
  referentIdGenerator = getReferentIdGenerator(parentId, REFERENT_GROUP);
  List<Event> events = new ReferentEventsAccumulator(parameters, eventFactory, styledTextReferenceElement, parentId, referentIdGenerator).accumulate();
  // TODO: substitute with a better check
  if (2 == events.size()) {
    addIsolatedCode(textFragment, styledTextReferenceElement);
    return false;
  }
  if (!events.get(0).isStartGroup()) {
    throw new IllegalStateException(UNEXPECTED_STRUCTURE);
  }
  addIsolatedCode(textFragment, styledTextReferenceElement, events.get(0).getStartGroup().getId());
  referentEvents.addAll(events);
  return false;
}

代码示例来源:origin: net.sf.okapi/okapi-core

sb.append("}");
} else if (e.isStartGroup()) {
  StartGroup sg = e.getStartGroup();
  sb.append(" { id:").append(nqs(sg.getId())).append(", ");
  printINameable(sb, "\t", sg);

代码示例来源:origin: net.sf.okapi.steps/okapi-step-rainbowkit

break;
case START_GROUP:
  writer.write(skelWriter.processStartGroup(event.getStartGroup()));
  break;
case START_SUBFILTER:

代码示例来源:origin: net.sf.okapi/okapi-core

case START_SUBFILTER:
  if (isCurrentTextUnit()) {
    StartGroup sg = event.getStartGroup();
    sg.setIsReferent(true);
    Code c = new Code(TagType.PLACEHOLDER, sg.getName(), TextFragment.makeRefMarker(sg.getId()));

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-idml

private void mergeStartGroup(ReferenceableEvent referenceableEvent) {
  StyledTextReferenceSkeleton styledTextReferenceSkeleton = (StyledTextReferenceSkeleton) referenceableEvent.getEvent().getStartGroup().getSkeleton();
  StoryChildElement.StyledTextReferenceElement styledTextReferenceElement = styledTextReferenceSkeleton.getStyledTextReferenceElement();
          ((StyledTextReferenceSkeleton) referenceableEvent.getEvent().getStartGroup().getSkeleton()).getStyledTextReferenceElement();

代码示例来源:origin: net.sf.okapi/okapi-core

isReferentGroup = event.getStartGroup().isReferent();
if (isReferentGroup) {
  skeletonWriter.processStartGroup(event.getStartGroup());

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-icml

@Override
public Event handleEvent (Event event) {
  switch ( event.getEventType() ) {
  case START_DOCUMENT:
    processStartDocument(event.getStartDocument());
    break;
  case END_DOCUMENT:
    processEndDocument();
    break;
  case START_GROUP:
  case START_SUBFILTER:
    processStartGroup(event.getStartGroup());
    break;
  case END_GROUP:
  case END_SUBFILTER:
    processEndGroup(event.getEndGroup());
    break;
  case TEXT_UNIT:
    processTextUnit(event.getTextUnit());
    break;
  default:
    break;
  }
  return event;
}

代码示例来源:origin: net.sf.okapi.steps/okapi-step-common

return verificationUtil.compareStartSubDocument((StartSubDocument)event1.getResource(), (StartSubDocument)event2.getResource());
case START_GROUP:
  return verificationUtil.compareBaseReferenceable(event1.getStartGroup(), event2.getStartGroup());
case START_SUBFILTER:
  return verificationUtil.compareBaseReferenceable(event1.getStartSubfilter(), event2.getStartSubfilter());

代码示例来源:origin: net.sf.okapi/okapi-core

break;
case START_GROUP:
  processStartGroup(event.getStartGroup());
  break;
case END_GROUP:

相关文章