Class PairsActor
java.lang.Object
com.scivicslab.pojoactor.core.ActorRef<PairsActor>
com.scivicslab.turingworkflow.workflow.IIActorRef<PairsActor>
com.scivicslab.turingworkflow.plugins.kanakanji.PairsActor
- All Implemented Interfaces:
com.scivicslab.pojoactor.core.CallableByActionName,AutoCloseable
Actor that validates LLM output and writes kana-kanji pairs to a TSV file.
Supported actions:
openOutput- Open output TSV file and write headercheckHiragana- Validate that hiragana column contains hiragana; fails if notwritePairs- Write validated pairs to output (with page/source metadata)closeOutput- Flush and close output file
-
Field Summary
Fields inherited from class com.scivicslab.pojoactor.core.ActorRef
actorName, actorSystem, object -
Constructor Summary
ConstructorsConstructorDescriptionPairsActor(String name, com.scivicslab.turingworkflow.workflow.IIActorSystem system) -
Method Summary
Modifier and TypeMethodDescriptioncom.scivicslab.pojoactor.core.ActionResultcheckHiragana(String response) Validate that the LLM response has proper tab-separated format and that the hiragana column actually contains hiragana characters.com.scivicslab.pojoactor.core.ActionResultcloseOutput(String args) Close the output file.com.scivicslab.pojoactor.core.ActionResultopenOutput(String filePath) Open the output TSV file.com.scivicslab.pojoactor.core.ActionResultsetPageInfo(String pageInfo) Set page metadata (page number and source filename) for subsequent writePairs calls.com.scivicslab.pojoactor.core.ActionResultwritePairs(String response) Write tab-separated pairs from the LLM response to the output file.Methods inherited from class com.scivicslab.turingworkflow.workflow.IIActorRef
callByActionName, hasAnnotatedAction, invokeAnnotatedAction, parseFirstArgumentMethods 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
-
Constructor Details
-
PairsActor
-
-
Method Details
-
openOutput
Open the output TSV file. Appends if file exists, creates if not. Writes header row on creation. -
setPageInfo
Set page metadata (page number and source filename) for subsequent writePairs calls. Argument format: "pageNum\tsourceFile" -
checkHiragana
Validate that the LLM response has proper tab-separated format and that the hiragana column actually contains hiragana characters. Returns failure if any tab-separated line has no hiragana in the left column. Returns success with the count of valid lines if all lines pass. -
writePairs
Write tab-separated pairs from the LLM response to the output file. Appends page and source columns. Skips lines without a tab. -
closeOutput
Close the output file.
-