- Scheme 97%
- Makefile 2.3%
- Common Lisp 0.7%
| .builds | ||
| ssd-recognizer | ||
| .gitignore | ||
| AGENTS.md | ||
| jpkg.sexp | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
| test-runner.ss | ||
jerboa-ssd-recognizer
jerboa-ssd-recognizer is the Jerboa-owned recognizer for Star Fleet Battles
SSD review data. It replaces the decision-making parts of the Python truth/OCR
service with reusable .ss code.
The library does not implement an OCR engine. It consumes OCR words from a
backend through jerboa-vision:
((text . "PH-1") (conf . 88) (bbox . (x1 y1 x2 y2)))
From there it owns the parts that must be identical on the server and APK:
- box-type aliases and canonical labels
- OCR text-to-box candidates
- learned truth examples from approved groups
- negative examples from deleted/suppressed groups
- race gating, such as PA Panels for Andromedans only
- feature scoring by count, position, size, aspect, and optional color
- compact truth lookup and source/page/dpi matching
Build
make test
By default the Makefile expects ../jerboa-vision beside this checkout. Override
with JERBOA_VISION=/path/to/jerboa-vision if needed.
API Shape
The main entry point is:
(ssd-recognize-groups payload)
Expected payload fields:
source: source metadata withname,path, optionalsource_keyimage: rendered imagewidthandheightgroups: detected SSD groups withid,bbox,count,cell_idsocr_words: backend OCR words in rendered image coordinateslearned_examples: examples generated from approved truth filesbox_types: SFBOL box type id/name listinventory: optional ship inventory counts from SFBOL/SFC data
The result contains suggestions, each with group_id, label, box_type_id,
confidence, reason, source, ocr_text, and candidate alternatives.
Truth service logic lives in ssd-recognizer/truth-store.ss. The important
entry point is:
(ssd-matching-truth-entries entries params)
It implements the Python service behavior for exact source-key matches, source-name/page/dpi fallback matches, compact metadata, and sorting more complete truth files first.
Migration Target
The current Python service can be retired in stages:
- Keep Python only as an OCR backend that returns words.
- Move
/api/recognizescoring to this library. - Move truth load/save/dump to the Jerboa SSD web service.
- Generate Android/Kotlin or Jerboa-Android code from this same data model.
- Replace the OCR backend with Android ML Kit for fully offline APK use.