Jump to content

Template talk:R:ota:Meninski

Page contents not supported in other languages.
Add topic
From Wiktionary, the free dictionary
Latest comment: 6 years ago by Sgconlaw in topic Linking columns

Linking columns

[edit]

@Sgconlaw There are multiple possibilities to link: 1. the copies from the Biblioteca Digital AECID, Example 1, Example 2, Example 3 (all accessible from the links given in the template in an orderly fashion). 2. Archive.org having the works 3. other digital presentations found through Europeana. As seen in {{R:gez:Dillmann}} I have already found a method whereby one can render the same link for two columns, checking if the column number is odd; and compare for example {{R:ar:Lane}} how I link to pages of a multiple-volume work which does not have column numbers starting at zero with each volume. At the Meninski template there is also an additional complication of code because the template is for all works of the author – I have this in an even more extreme fashion in the quotation template {{RQ:Deschner}}. The issue, where I fail, is the one of mathematical creativity. How to calculate URLs from column numbers if the URLs refer to pages? For the Schweizerisches Idiotikon template and the Dillmann template the URLs are based on column numbers and now with Meninski it is different. Fay Freak (talk) 00:34, 28 August 2018 (UTC)Reply

Wow, this is tricky, and I don't have a solution yet. The column numbers obviously increase more quickly than the URL page numbers, as follows:
Odd column numbers Even column numbers
1 (+26) = page 27 2 (+25) = page 27
3 (+25) = page 28 4 (+24) = page 28
5 (+24) = page 29 6 (+23) = page 29
7 (+23) = page 30 8 (+22) = page 30
[...]
1693 (-820) = page 873 1694 (-821) = page 873
1695 (-821) = page 874 1696 (-822) = page 874
1697 (-822) = page 875 1698 (-823) = page 875
1699 (-823) = page 876 1700 (-824) = page 876
Thus, the difference between the column number and the URL page number decreases steadily and changes from positive to negative. I'm afraid I haven't been able to work out a formula for determining the difference yet. In the meantime you may just have to require users to manually specify the URL. — SGconlaw (talk) 04:05, 28 August 2018 (UTC)Reply
In the meantime you may just have to require users to manually specify the URL. Not really, as one who uses such scans more often downloads the whole thing so he does not know the page URLs then (or, this is what I do, it is true for the frequent users). This is why we infer the URLs by automatic methods. The meantime is generous though as there hasn’t been yet anyone who seriously wants to add Ottoman entries to Wiktionary – for the future though, for the prospective users of this template and possible other templates yet to be created which need the same formula, you understand, this is a riddle to solve. Fay Freak (talk) 07:46, 28 August 2018 (UTC)Reply
Well, since the scans are available online, you can provide links to the websites on the template documentation page so that editors can look up the URLs and manually insert them into the template. I have done that in some reference templates when the page numbering of specific works is so erratic that the URL cannot be determined by calculation. I'm not sure whether there is any convenient formula to relate the column numbers to the URL page numbers, but I'll think about it some more. — SGconlaw (talk) 08:07, 28 August 2018 (UTC)Reply
For erratic numbers too I have ifexpr for page ranges used, like on: {{R:Nöldeke:Neue Beitr.}}. {{R:arc:Löw-Flora}} needed the same because of a few pages with images being unnumbered. Fay Freak (talk) 08:39, 28 August 2018 (UTC)Reply
I have been using {{#ifexpr:}} in some cases too, but I did not know I could use "Module:ugly hacks" in that way (I'm not familiar with Lua) so thanks for pointing that out. I was referring to cases where the page numbering is very unpredicable due to misnumbering, especially when the work is old. Also, some old works do not have any page numbering at all. — SGconlaw (talk) 09:27, 28 August 2018 (UTC)Reply

──────────────────────────────────────────────────────────────────────────────────────────────────── @Fay Freak: OK, I figured it out! The formula for example 1 is as follows:

{{#ifexpr:({{{column|}}} mod 2)=0
  | {{#expr:{{{column}}}/2+26}}
  | {{#expr:({{{column}}}+1)/2+26}}
}}

The formula works as follows:

  1. Check if the column number is odd or even.
  2. If it is even, then divide the column number by two to determine its sequential position, then add 26 to the result.
  3. If it is odd, then add 1 to the column number first before dividing it by two, then add 26 to the result.

SGconlaw (talk) 13:28, 28 August 2018 (UTC)Reply

Now the complement will have its pages automatically linked. There are three irregularities in the numbering which I have no plans to deal with:

  1. For some reason the book begins being numbered by pages 16 pages, then follow column 17, column 18 and so on.
  2. There are column numbers 777*, 777**, 777***, 777**** after column 777 on two pages.
  3. The worst: 980–989 are assigned twice each, after column 989 comes column 980 again.

In total this amounts to 23 from a total of 1014 pages which cannot be automatically linked, that is to say that the template can link automatically to 97.73 % of the Complement. The Thesaurus has columns 4787–4790 twice after 4790, which results in 25 pages from 4056 not being automatically linked, i. e. 99,38 % can be linked, if there aren’t more irregularities in the other three thesaurus volumes. 
Hola @Vahagn Petrosyan and @Anylai or whoever cares about Ottoman Turkish: Use Meninskis’s dictionaries liberally because this template automatically puts pagelinks to them, and steal the code if necessary. @Sgconlaw Fay Freak (talk) 18:20, 28 August 2018 (UTC)Reply

If you can’t deal with these using {{#if:}} or {{#ifeq:}}, you may just have to document the irregularities on the template documentation page and advise users to specify the URL manually (and provide a way to do that). — SGconlaw (talk) 01:39, 29 August 2018 (UTC)Reply
My suggestions would be:
  1. For the work with pages 1–16, allow users to specify the page numbers using a statement like: {{#ifeq:{{{page|}}}|[URL]}}.
  2. For the column numbers in the form "777*", test for them using a series of {{#ifeq:{{{column|}}}}} statements.
  3. For the duplicated column numbers, advise users to specify "980A", "981A", etc., for the second set, and check for these using {{#ifeq:{{{column|}}}}} statements.
SGconlaw (talk) 03:16, 29 August 2018 (UTC)Reply