Repository navigation
fix(elos): better grounded answers on real course slides; faster MCP sources #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,8 +57,12 @@ export function titleFromFileName(fileName: string): string { | |
| * extracts as separate fragments ("modi fi er", "fi chier") and normalises whitespace, | ||
| * keeping paragraph breaks. | ||
| */ | ||
| const SPACING_ACCENTS: Readonly<Record<string, string>> = { "\u00B4": "\u0301", "\u0060": "\u0300", "\u02C6": "\u0302", "\u00A8": "\u0308", "\u0301": "\u0301", "\u0300": "\u0300", "\u0302": "\u0302", "\u0308": "\u0308" }; | ||
|
|
||
| export function cleanExtractedText(text: string): string { | ||
| return text | ||
| // LaTeX-made PDFs extract accents as separate marks before the letter ("exprim ́ ee" → "exprimée"). | ||
| .replace(/ ?([\u00B4\u0060\u02C6\u00A8\u0300-\u0302\u0308]) ?([aeiouAEIOU])/g, (_match, mark: string, letter: string) => (letter + SPACING_ACCENTS[mark]).normalize("NFC")) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Markdown or text contains code whose opening backtick precedes a vowel, such as Useful? React with 👍 / 👎. |
||
| .normalize("NFKC") | ||
| .replace(/\r\n?/g, "\n") | ||
| // One space on the left means the fragment is inside a word; several mean a word boundary. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the only relevant source sentence has fewer than four whitespace-separated words, such as
TCP est fiable., the passage passes retrieval and answerability but this filter removes its sole sentence, causinganswerFromSourcesto report that the information is absent. The previous implementation returned such exact source answers, so title suppression should not use an unconditional four-word minimum for otherwise declarative, relevant sentences.Useful? React with 👍 / 👎.