Tags:
create new tag
, view all tags

GeneralizingFindElsewhereAndPluralHandling

As DoWhatIMean says, TWiki already does a limited form of "do what I mean", by inferring a link to a singular WikiTopic when a link to a plural WikiTopics is not found.

Similarly, FindElsewherePlugin provides a limited form of "do what I mean", by following a list, a path, of webs, to find a page that does not exist in the original web.

Unpluralization Problems

Pluralization and unpluralization is language specific. Even in English, removing "s" to get singular does not always work. In other languages...

But, I also find the default recommendation - unpluralizing, creating a singular page and automatically having links unpluralized - annoying. E.g. I have a topic page called "!MyIssues". It would be inappropriate to call it "!MyIssue" - there are multiple issues on that page. But I might want to be able to create an easy to write wiki link MyIssue, and have it get linked to MyIssues. E.g.

    The question of pluralization is a MyIssue.
As opposed to
    The question of pluralization is one of MyIssues.
It doesn't make much difference here, but, believe me, often the sentences read a lot better if the link is singular, but the page name is plural.

Moreover... I often get into the situation where I write for a long time without creating the page. Sometimes I use singular, sometimes plural. Sometimes I use a singular link before I realize that there are plural, and that the target page should be plural. (E.g I might originally be writing only about MyInvention or MyPatent, but it turns into MyInventions or MyPatents by the time I am finished.)

Given the current behavior, unpluralization, you need to create the unplural topic, and the plural topics will be linked to it. ... Or, you can create the plural topic, and then unpluralize it using topic renaming, so long as you remember not to update any links. If you update links, you will get sentences that read badly, such as

    The question of pluralization is one of MyIssue.

But if you create the unplural topic, and then realize it should be renamed as a plural, you don't get the benefit of automatic unpluralization. If you update the old unplural links, the resulting sentences will read badly because they will be using plural instead of singular. If you don't rename the page, the link will be broken.

Solution

What is needed is a way to leave the old singular links valid, but to establish a link to the new page.

One way to do this might be to convert any WikiWord link to a doublebracket [[WikiWords][WikiWord]]. This approach would be useful not just to plural/singular, but to any link that gets renamed. But this is not what I want to talk about here. (See RenamingTargetPageWithoutChangingLinkText.)

Here, I want to suggest the possibility of GeneralizingFindElsewhereAndPluralHandling. If a page is not found, go through a succession of transformations, trying to find it.

For example, now, when we look for SomeWikiPageAboutFoos, we do

  • try SomeWikiPageAboutFoos
  • unpluralize SomeWikiPageAboutFoo
  • possibly use FindElsewherePlugin
    • try Path1.!SomeWikiPageAboutFoo
    • try Path2.!SomeWikiPageAboutFoo
    • ...

Wrt pluralizing unpluralizing, I want to do

  • try TheOriginalPage
  • try singular/plural alternatives
    • if the original page ends with s, try removing an s - TheOriginalMethods -> TheOriginalMethod
    • if the original page did not end with an s, try adding the s - TheOriginalMethod -> TheOriginalMethods
  • possibly use FindElsewherePlugin
    • try Path1.!SomeWikiPageAboutFoo
    • try Path2.!SomeWikiPageAboutFoo
    • ...

So that this is not English specific, I suggest that regexps be used - i.e. a path of regexps:

  • try $topic
  • try singular/plural alternatives
    • $topic =~ s/(.*)s$/\1/
    • $topic =~ s/(.*[^s])$/\1s/
  • possibly use FindElsewherePlugin
    • $topic s/.*/Path1.\1/
    • $topic s/.*/Path2.\1/
    • ...

The only real issue is whether the transformations interact orthogonally, or not interact:

  • try $topic
  • try singular/plural alternatives
    • $topic =~ s/(.*)s$/\1/
    • $topic =~ s/(.*[^s])$/\1s/
  • possibly use FindElsewherePlugin
    • $topic s/.*/Path1.\1/ * try singular/plural alternatives * $topic =~ s/(.*)s$/Path1.\1/ * $topic =~ s/(.*[^s])$/Path1.\1s/
    • $topic s/.*/Path2.\1/ * try singular/plural alternatives * $topic =~ s/(.*)s$/Path2.\1/ * $topic =~ s/(.*[^s])$/Path2.\1s/

I would probably say "No"; or, rather, I would say that the regexp transformation path (used for pluralization) should be a property of a web - assuming that any given web is in a language, and that the path of webs should use the regexp transformation path of each web as it is encountered.

Other Considerations

What happens when both the plural and unplural versions of a page exist? Which should you use? Obviously, I contend, whatever is written in the text.

But this could result in links that were to a meaningful page suddenly being redirected when a new link is added.

It would be nice to have the ability to "pin" links - to convert all links to Foo to [[Foos][Foo]].

Oh, Shit

I started out thinking this had to be done in the TWiki core, the way unpluralization is done.

But obviously it can be done via a plugin, since FindElsewherePlugin can be.

So I should stop pontificating, and start coding, right?

-- Contributors: AndyGlew

Discussion

-- AndyGlew - 28 Mar 2006

Right! wink

-- FranzJosefSilli - 29 Mar 2006

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2006-03-29 - FranzJosefSilli
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.