更新
This commit is contained in:
@@ -40,7 +40,9 @@ $query = '患者糖尿病、高血糖,请分析病症。';
|
||||
$sources = TcmAncientBooksReference::sourcesForText($query);
|
||||
ancientExpect(count($sources) === 1, 'matching patient symptoms select one excerpt');
|
||||
ancientExpect($sources[0]['title'] === '测试古籍' && $sources[0]['chapter'] === '消渴篇', 'book and chapter retained');
|
||||
ancientExpect(str_ends_with($sources[0]['url'], '/123-%E6%B5%8B%E8%AF%95%E5%8F%A4%E7%B1%8D.txt#L42'), 'permalink pins file and line');
|
||||
ancientExpect($sources[0]['url'] === '' && $sources[0]['path'] === '123-测试古籍.txt' && $sources[0]['line'] === 42,
|
||||
'local citation retains file and line without an external URL');
|
||||
ancientExpect($sources[0]['excerpt'] === '原文中谈到消渴的历史记载。', 'local citation retains verifiable original text');
|
||||
ancientExpect(TcmAncientBooksReference::sourcesForText('请分析耳鸣。') === [], 'unmatched symptoms have no invented citation');
|
||||
ancientExpect(TcmAncientBooksReference::sourcesForText('患者出现痛风症状。')[0]['line'] === 88, 'unlisted diseases can match indexed chapter headings');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user