Skip to content

Private AI meeting notes that stay on your computer. No meeting bot. Free and open source for Mac, Windows and Linux. An alternative to Granola, Otter and Fireflies.

Ask: citations listed with commas show one number per meeting

christianmat3eb7c9cb6e8f
diff --git a/app/src/shared/citations.ts b/app/src/shared/citations.ts
index 2ce21fa2..e82376ce 100644
--- a/app/src/shared/citations.ts
+++ b/app/src/shared/citations.ts
@@ -7,8 +7,8 @@ import { mdToDoc, type PMNode } from './markdown'
/** one [1] or [1, 2] */
export const CITE = /\[(\d+(?:\s*,\s*\d+)*)\]/g
-/** citations side by side ("[1][2] [3]"): read as one */
-const RUN = /\[\d+(?:\s*,\s*\d+)*\](?:\s*\[\d+(?:\s*,\s*\d+)*\])*/g
+/** citations side by side ("[1][2] [3]"), or listed ("[1], [2] and [3]"): read as one */
+const RUN = /\[\d+(?:\s*,\s*\d+)*\](?:\s*(?:,|;|&|and)?\s*\[\d+(?:\s*,\s*\d+)*\])*/g
/** with this many meetings or more found, a citation naming most of them is a pile, not a source */
const PILE_FROM = 4
diff --git a/app/test/citations.test.ts b/app/test/citations.test.ts
index 26ff5822..ffaebc2b 100644
--- a/app/test/citations.test.ts
+++ b/app/test/citations.test.ts
@@ -16,6 +16,11 @@ describe('citations in an answer', () => {
expect(tidyCitations('It came up [1][2] [3, 4].', of('aaab'))).toBe('It came up [1, 4].')
expect(tidyCitations('- With Dana [2] [3] [4] [5] [6]\n- Other [1]', of('baaaaa'))).toBe('- With Dana [2]\n- Other [1]')
})
+ it('reads citations listed with commas or "and" as one, so one meeting shows one number', () => {
+ expect(tidyCitations('A session titled "Retell" [1], [2], [3].', of('aaa'))).toBe('A session titled "Retell" [1].')
+ expect(tidyCitations('Pricing [1] and [3]; launch [2].', of('aab'))).toBe('Pricing [1, 3]; launch [2].')
+ expect(tidyCitations('Pricing [1] and Bo said so [2].', of('ab'))).toBe('Pricing [1] and Bo said so [2].')
+ })
it('drops a pile that cites most of the meetings at once: that points at nothing in particular', () => {
expect(tidyCitations('Nothing here is about politics [1][2][3][4][5][6].', of('abcdefgh'))).toBe('Nothing here is about politics.')
expect(tidyCitations('No word of it [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].', of('aabbccddee'))).toBe('No word of it.')