On 2022/09/23 6:18, Juan Pablo Santos Rodríguez wrote:
Hi,

I'd say you've found all the documentation that there is about that :-/
Basically if the jspwiki.translatorReader.matchEnglishPlurals property is
set to true, then pages ending with 's' are considered the same as their
singular form when linking between them. It does not prevent you from
having both kinds of pages - we fall back to the other one if the primary
name does not exist.

Although doing the work, is a bit naive, so it is recommended only for
english wikipages. Don't know if it would be worth implementing for a
custom ReferenceManager, or if it could be implemented with a more complex
logic or if it makes sense to mimic the same logic on the
DefaultReferenceManager..

The matchEnglishPlurals feature is only meant for English wiki pages, but
given that the localisation of the wiki itself isn't actually taken into
account at all by the current code (i.e., the code for this isn't aware of
the localisation), this is clearly a setting that a wiki admin explicitly
makes understanding that their wiki is predominantly English. E.g., if the
wiki were in German with the flag set true it wouldn't work properly.

I hadn't thought about the notion of not conforming to the same rules as the
existing DefaultReferenceManager, not supporting the matchEnglishPlurals, or
supporting it differently. But the latter is not a bad alternative.

I can get almost all of the existing tests to pass, but not all. If I make
one slight change in the code the tests that didn't pass will pass, but that
breaks a different set of tests. This suggests that it might be either very
difficult or impossible to mimic the existing behaviour with a different
implementation, and of course any programmatic handling of English plurals
is never going to be 100% correct anyway. So I think I might aim for a
reasonable compromise and just call that Victory. I've spent probably too
much time on this already, as it's quite a difficult implementation and
there's still a fair bit of graph-related work to start.

Cheers,

Murray

On Mon, Sep 19, 2022 at 10:22 AM Murray Altheim <murra...@altheim.com>
wrote:

Hi,

I'm struggling with the modifications necessary to implement a replacement
ReferenceManager using a graph backend, and in a somewhat surprising place:
namely, passing tests related to parsing plurals. I can kinda figure what
is meant from the various tests, but overall I can't discern a policy on
how to handle references to wiki page names, how to deal with page creates
or updates in either direction of a singular-to-plural update, plural-to-
singular, whether or not to consider an initial link to a singular or
plural as to the same page, etc.  These kinds of questions can be seen in
tests like testPluralSingularUpdate1, testPluralSingularUpdate2, and
testPluralSingularUpdate3 in ReferenceManagerTest.

Is there anywhere documented the actual policy on how to handle singular
and plural wikiNames in either page names or links? I've only found the
one paragraph in the properties file.
...........................................................................
Murray Altheim <murray18 at altheim dot com>                       = =  ===
http://www.altheim.com/murray/                                     ===  ===
                                                                   = =  ===
    In the evening
    The rice leaves in the garden
    Rustle in the autumn wind
    That blows through my reed hut.
           -- Minamoto no Tsunenobu

Reply via email to