Skip to main content

Module notes

Module notes 

Source

Structs§

Chunk
切片不再重复携带 source/title;路径与标题经 note_id 关联 notes 取回。 切片正文只在索引里存一份:写入时切好、就地写进索引,content 读取时从索引取回。
Note
笔记的对外形态:库内只留路径,正文读时按 source 读文件,标题由文件名派生。
NoteFileInput
按文件路径同步一篇笔记的入参:库自己读文件,标题取文件名(去扩展名)。 路径存为笔记自己的一列:领域登记过根目录时存减掉根目录的相对路径,否则逐字符原样存。 它既用来读回正文,也用来定位同一文件。 正文真相源是文件:清洗只作用于送进索引的文本,库内不留任何正文副本。
NoteStore
TextChunk
offset 为 1 起始的起始行,limit 为行数。切片正文由 content 自带, 超长段落被多个切片共享同一行号也不影响取回。

Functions§

chunk_text
Paragraph-aware chunking. Fenced code and tables are atomic, even above the target size. A long prose line may span chunks sharing that same line number.