Hi Mario, thanks for the response.

There is a little work around, that looks a bit strange. eg: I found some
> [[book|??]]s.   So the link will only cover the book text. I know that's
> not pretty but it creates valid sentences.


Thanks, this is probably the best workaround.

The question is interesting and valid, and it seems to be an easy change.
> .. But due to its language specific nature, it isn't. Implementing it will
> probably double the actual complexity of the plugin.


Of course - I was not expecting there to be an easy way to build this into
the plugin. I just wondered if there was an easy way to hack it.

Having said that, I did have an idea. Not sure if it makes sense or not,
but I'll put it out there: You could allow users to add an optional filter
expression to be applied to the search term before it is used.

For example take [[books|??]]. By default this will work as it currently
does, but from a global config the user could add the filter trim:suffix[s].
This would be applied to [[books]] and then the result used as the search
term.

Although I think this would largely solve my problem, I'm not sure how
useful it would be in general, but I thought I'd put it out there.

On Mon, 28 Jun 2021 at 07:37, PMario <[email protected]> wrote:

> On Sunday, June 27, 2021 at 10:58:41 PM UTC+2 Si wrote:
> ...
>
>> I only just noticed your Uni-link Search feature! Very handy -  I have
>> been frequently writing things like [[really good idea|Really Good Ideas]],
>> so this will save me a lot of time.
>>
>
> There is a little work around, that looks a bit strange. eg: I found some
> [[book|??]]s.   So the link will only cover the book text. I know that's
> not pretty but it creates valid sentences.
>
> The second workflow that works immediately is: *using aliases* eg: The
> "Books" tiddler gets 2 of them "book" and "books" may be [[new books]] and
> so on .... Use *[[book|?]] or [[books|?]]* problem solved.
>
>
>> I have a question however: Is there any way to customise exactly how the
>> search is applied?
>>
>
> At the moment - no. ... The function is executed directly in javascript.
>
>
>> I'm wondering if there is a way to use Uni-link search, but tweak it so
>> it will ignore the final "s"? So [[books|??]] would automatically link to
>> [[Book]].
>>
>
> The main problem is, that singular / plural rules depend on the language.
> book - books in German is Buch - Bücher
> So a hardcoded rule won't help the plugin.
>
> The second problem is, that it has to work in both directions. So imo a
> link like [[books|??]] needs to search for "book" and "books"  ...
> [[book|??]] has to do the same thing. ... This will make the search
> function 50% slower :/
>
> It would be possible to implement "plural" / "singular" filter rules. But
> they will be language specific. Some 3rd party libraries will be needed. So
> there would be an additional plugin per language.
>
> UNI-LINK alias already uses macros instead of hardcoded links. ... but at
> the moment link-search outputs a "link", so the built-in "backlinks"
> handling works. If link-search would output a macro, a new "backlinks"
> handling will be needed. :/  I know how to do it, but it would add extra
> complexity.
>
> The re-link plugin is very popular and I try to keep uni-link compatible
> with it. IMO the singular / plural links will definitely be out of the
> scope, what re-link should handle. ...
>
> The question is interesting and valid, and it seems to be an easy change.
> .. But due to its language specific nature, it isn't. Implementing it will
> probably double the actual complexity of the plugin.
>
> So all in all using aliases instead of link-search will win in terms of
> simplicity. .. And aliases don't need language specific plugins ..
>
> hope that helps
> mario
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "TiddlyWiki" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/tiddlywiki/35_6ltCXEvs/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/a68737d8-c2ab-457d-91c8-d0942d696133n%40googlegroups.com
> <https://groups.google.com/d/msgid/tiddlywiki/a68737d8-c2ab-457d-91c8-d0942d696133n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CAKKx7WYXyz8YA3JZeZt5%3DwRnPhh-JWeybSAZYGqRVmEWxvsxxA%40mail.gmail.com.

Reply via email to