OCRD工作区的可扩展查看器
browse-ocrd的Python项目详细描述
OCR-D浏览器
截图
在Ubuntu 18.04上安装
sudo make deps-ubuntu
pip install browse-ocrd
使用
^{pr2}$特点
- 浏览filegrp和页面,将视图相邻排列以进行比较
- 显示原始图像或派生图像(
AlternativeImage
在结构层次结构的任何级别上) - 一次显示不同页面(水平)或不同段(垂直)的多个图像,可自由缩放
- 用语法高亮显示原始PAGE-XML,用PageViewer打开
- 显示连接的PAGE-XML文本批注
- 从dinglehopper计算显示呈现的HTML比较
配置
配置文件位置
启动时,在以下目录中搜索名为ocrd-browser.conf
的配置文件
# directories and their default values under Ubuntu 20.04GLib.get_system_config_dirs()# '/etc/xdg/xdg-ubuntu/ocrd-browser.conf', '/etc/xdg/ocrd-browser.conf'GLib.get_user_config_dir()# '/home/jk/.config/ocrd-browser.conf' os.getcwd()# './ocrd-browser.conf'
配置文件语法
ocrd-browser.conf
文件是一个ini文件,具有以下键:
[FileGroups]# Preferred fileGrp names for thumbnail display in the Page Browser # Comma seperated list of regular expressionspreferredImages=OCR-D-IMG, OCR-D-IMG.*, ORIGINAL# Each Tool has a section header [Tool XYZ]# At the moment the only defined tool is "PageViewer" [Tool PageViewer]# (ba)sh commandline to execute with placeholders commandline=/usr/bin/java -jar /home/jk/bin/JPageViewer/JPageViewer.jar --resolve-dir {workspace.directory} {file.path.absolute}
commandline
字符串将用作python格式的字符串,其中包含关键字参数:
workspace
:当前的ocrd.Workspace
,所有属性都会被shell自动转义(由shlex.quote
)自动转义。在file
:当前的ocrd_models.OcrdFile
,所有属性都自动得到shell转义(通过shlex.quote
),还有一个附加属性path
,其属性为absolute
和{},因此 {file.path.absolute}
将替换为文件的shell引用的绝对路径。在
Note: You can get PRImA's PageViewer at Github.
- 项目
标签: