java.lang.Object
com.scivicslab.pojoactor.core.ActorRef<OcrActor>
com.scivicslab.turingworkflow.workflow.IIActorRef<OcrActor>
com.scivicslab.turingworkflow.plugins.kanakanji.OcrActor
All Implemented Interfaces:
com.scivicslab.pojoactor.core.CallableByActionName, AutoCloseable

public class OcrActor extends com.scivicslab.turingworkflow.workflow.IIActorRef<OcrActor>
Actor that reads OCR TSV files and provides page text one page at a time.

OCR TSV format: hiragana TAB kanji TAB page (hiragana column is always empty).

Supported actions:

  • loadFile - Load a single OCR TSV file
  • nextPage - Advance to next page; returns fail when exhausted
  • getPageText - Get current page OCR text (newline-joined fragments)
  • getPageInfo - Get current page number and source filename
  • Field Summary

    Fields inherited from class com.scivicslab.pojoactor.core.ActorRef

    actorName, actorSystem, object
  • Constructor Summary

    Constructors
    Constructor
    Description
    OcrActor(String name, com.scivicslab.turingworkflow.workflow.IIActorSystem system)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.scivicslab.pojoactor.core.ActionResult
    Get metadata about the current page: "pageNum\tsourceFile".
    com.scivicslab.pojoactor.core.ActionResult
    Get the OCR text of the current page (fragments joined by newlines).
    com.scivicslab.pojoactor.core.ActionResult
    loadFile(String filePath)
    Load an OCR TSV file.
    com.scivicslab.pojoactor.core.ActionResult
    Advance to the next page.

    Methods inherited from class com.scivicslab.turingworkflow.workflow.IIActorRef

    callByActionName, hasAnnotatedAction, invokeAnnotatedAction, parseFirstArgument

    Methods inherited from class com.scivicslab.pojoactor.core.ActorRef

    ask, ask, askNow, clearJsonState, clearPendingMessages, close, createChild, expandVariables, getJsonBoolean, getJsonInt, getJsonString, getJsonString, getLastResult, getName, getNamesOfChildren, getParentName, hasJson, hasJsonState, initLogger, isAlive, json, putJson, setLastResult, setParentName, system, tell, tell, tellNow, toStringOfJson, toStringOfYaml

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OcrActor

      public OcrActor(String name, com.scivicslab.turingworkflow.workflow.IIActorSystem system)
  • Method Details

    • loadFile

      public com.scivicslab.pojoactor.core.ActionResult loadFile(String filePath)
      Load an OCR TSV file. Groups kanji-column text by page number.
    • nextPage

      public com.scivicslab.pojoactor.core.ActionResult nextPage(String args)
      Advance to the next page. Returns failure (false) when all pages are exhausted. This causes the workflow to try the next row (e.g., transition to end state).
    • getPageText

      public com.scivicslab.pojoactor.core.ActionResult getPageText(String args)
      Get the OCR text of the current page (fragments joined by newlines).
    • getPageInfo

      public com.scivicslab.pojoactor.core.ActionResult getPageInfo(String args)
      Get metadata about the current page: "pageNum\tsourceFile".