sawhney17 / logseq-automatic-linker

MIT License
87 stars 16 forks source link

Set priority of word combinations to the longest word combination found #38

Closed Corvalan closed 1 year ago

Corvalan commented 1 year ago

Currently in automatic linker, single words receive priority above multi-word page titles. For example, having pages

And a random page with the text "Good work ethics are important.."

Has the result that automatic linker only auto-links the single word 'work', resulting in "Good [[work]] ethics are important"

This obviously is counter productive. Better would be to prioritize the more specific multi-word title.

sawhney17 commented 1 year ago

Likely  a sim9e code fix will change the behaviour. On 14 Oct 2022, 3:43 PM +0400, Yuri @.***>, wrote:

Currently in automatic linker, single words receive priority above multi-word page titles. For example, having pages

• Work Ethics • Work

And a random page with the text "Good work ethics are important.." Has the result that automatic linker only auto-links the single word 'work', resulting in "Good [[work]] ethics are important" This obviously is counter productive. Better would be to prioritize the more specific multi-word title. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

andremann commented 1 year ago

Potentially related to #31 It looks like the linker adopts a greedy strategy, while longest match would make more sense.

sawhney17 commented 1 year ago

Latest update should address this.

Corvalan commented 1 year ago

Hi, I have the latest version, but automatic-linker still does not prioritize long words including a word segment, above the word segment itself. For example, I have two pages 'co working' and 'working'. 'co working' contains the word 'working' and when writing a block with the link to the page "co working" in it, and press enter, automatic linker creates a link of the word 'working'

Can you confirm this is still the case? Thanks