动机与需求假设
原能力
根据已有表达提出多种可能解释,列出支持线索、反例和待向本人核对的问题。(细化版 p.2–3)
首选项目
Taguette(BSD-3-Clause)。 Taguette
匹配范围
标签、批注和导出管理候选解释及原文。
源码
Taguette · class Tag
taguette/database/models.py · 617–630 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
class Tag(Base):
__tablename__ = 'tags'
__table_args__ = ({'sqlite_autoincrement': True},)
id = Column(Integer, primary_key=True)
project_id = Column(Integer, ForeignKey('projects.id', ondelete='CASCADE'),
nullable=False, index=True)
project = relationship('Project', back_populates='tags')
path = Column(String(200), nullable=False, index=True)
description = Column(Text, nullable=False)
__table_args__ = (
UniqueConstraint('project_id', 'path'),
Taguette · class Highlight
taguette/database/models.py · 592–605 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
class Highlight(Base):
__tablename__ = 'highlights'
__table_args__ = ({'sqlite_autoincrement': True},)
id = Column(Integer, primary_key=True)
document_id = Column(Integer, ForeignKey('documents.id',
ondelete='CASCADE'),
nullable=False, index=True)
document = relationship('Document', back_populates='highlights')
start_offset = Column(Integer, nullable=False)
end_offset = Column(Integer, nullable=False)
snippet = Column(Text, nullable=False)
tags = relationship('Tag', secondary='highlight_tags',
back_populates='highlights')
实现与验收要点
生成互相独立的解释、关联反证,记录本人否定或确认。