Wikifunctions:Project chat - Wikifunctions
Jump to content
From Wikifunctions
Latest comment:
2 hours ago
by YoshiRulz in topic
Help with creating a function for Abstract Wikipedia
Shortcuts
WF:CHAT
WF:PC
WF:VP
Welcome to the Project chat, a place to discuss any and all aspects of Wikifunctions: the project itself, policy and proposals, individual data items, technical issues, etc.
Other places to find help:
Wikifunctions:Administrators' noticeboard
Wikifunctions:Report a technical problem
Wikifunctions:FAQ
SpBot
archives
all sections tagged with
{{
Section resolved
1=
}}
after 1 day and sections whose most recent comment is older than 30 days.
edit
Archives
2023/08
2023/09
2023/10
2023/11
2023/12
2024/01
2024/02
2024/03
2024/04
2024/05
2024/06
2024/07
2024/08
2024/09
2024/10
2024/11
2024/12
2025/01
2025/02
2025/03
2025/04
2025/05
2025/06
2025/07
2025/08
2025/09
2025/10
2025/11
2025/12
2026/01
2026/02
2026/03
2026/04
Wikifunctions & Abstract Wikipedia Newsletter #238 is out: Citations and Copy and Paste
Latest comment:
23 days ago
7 comments
5 people in discussion
There is
a new update
for Abstract Wikipedia and Wikifunctions. Please, come and read it!
In this issue, we introduce the possibility of creating a function that deals with references and a Wikifunctions internal clipboard, where you can temporarily store any piece of code in order to paste it somewhere else, and we take a look at the latest software developments.
Want to catch up with the previous updates? Check
our archive
Enjoy the reading! --
User:Sannita (WMF)
talk
17:28, 6 March 2026 (UTC)
Reply
Is there a function in Wikifunctions to get all sources to a statement in a Wikidata item. At the moment my main activity in the Wikimedia projects is adding sources to Wikidata statements. For this case I got the following kind of
query
to get all qualifiers and sources for a specific statment in explicit mentioned items in the query. There are already templates for citing sources in different Wikipedia language versions. For example the template
Cite web
is used in 298 Wikipedia language versions. So it is a widely used template and I wish a implementation for it in Wikifunctions.
Hogü-456
talk
21:31, 8 March 2026 (UTC)
Reply
References (citations) of Wikidata statement (
Z31984
YoshiRulz
talk
15:08, 9 March 2026 (UTC)
Reply
Tracked in
Phabricator
Task T404652
Yes and no. Importing of Wikidata references is currently turned off.
GrounderUK
talk
15:27, 9 March 2026 (UTC)
Reply
Tracked in
Phabricator
Task T419350
I found
a bug
where the clipboard feature becomes unusable.
Also, it's a bit disappointing that it doesn't use the real clipboard, not even as an option for egress. If you're invoking a function and you can get it to "compile", then "Copy result link" already lets you copy out the full canonical form...
YoshiRulz
talk
02:58, 10 March 2026 (UTC)
Reply
YoshiRulz
Thanks for reporting, I noticed the team about it. I will see if we can fix it soon.
Sannita (WMF)
talk
10:26, 11 March 2026 (UTC)
Reply
It's fixed 🤩
So9q
talk
14:38, 31 March 2026 (UTC)
Reply
Broken function
Latest comment:
29 days ago
5 comments
4 people in discussion
Can someone please revert the most recent revision (by
User:GrounderUK
) on
Z29362
? It appears that it always returns void, breaking a lot of abstract wiki in the process.
MetalBreaksAndBends
talk
18:13, 25 March 2026 (UTC)
Reply
This implementation is broken, but it's disconnected, no? Shouldn't be breaking abstractwiki.
infernostars
talk
) (
contribs
21:29, 25 March 2026 (UTC)
Reply
Looks like someone disconnected it after I wrote that comment, but before you wrote yours.
MetalBreaksAndBends
talk
22:24, 25 March 2026 (UTC)
Reply
It seems to have been reconnected, but the issue looks like it has started working again, per all passed tests.
~/Bunny
pranav
ping
08:04, 26 March 2026 (UTC)
Reply
This was the result of a
breaking change in the software
. I didn’t amend the implementation until after it had been disconnected, and all tests passed after the change. I think the issue is now resolved, but I’ll link this comment to the Phabricator ticket for “lessons learned”. Sorry I didn’t pick this up earlier, but this particular software change was unexpected.
GrounderUK
talk
08:46, 26 March 2026 (UTC)
Reply
Language tags
Latest comment:
27 days ago
1 comment
1 person in discussion
I would appreciate input on
Talk:Z14326#Case-sensitivity
re: the exact semantics of
Natural language (
Z60
's identity key. CC @
99of9
since you connected one of the tests but not the others.
YoshiRulz
talk
14:27, 27 March 2026 (UTC)
Reply
Upcoming Wikimedia Café meetup regarding the
the 2026-2027 Wikimedia Foundation Annual Plan
Latest comment:
18 hours ago
2 comments
2 people in discussion
Hello! There will be a
Wikimedia Café
meetup on
Saturday, 11 April 2026 at 14:00 UTC
timestamp conversion tool
), focusing on the
the 2026-2027 Wikimedia Foundation Annual Plan
. The featured guests will be
Kelsi Stine-Rowe
(senior manager,
Movement Communications
, Wikimedia Foundation), and
Sam Walton
(senior product manager,
Moderator Tools
, Wikimedia Foundation).
In addition to this Café session,
several additional meetings regarding the Annual Plan are listed on the Collaboration page
, and you may participate on the
talk page
This Café meetup will be approximately two hours long. Attendees may choose to attend only for a part. Please see the Café page for more information, including
how to register
↠Pine
05:26, 29 March 2026 (UTC)
Reply
This section is resolved and can be archived. If you disagree, replace this template with your comment.
rae
5e
talk
14:52, 23 April 2026 (UTC)
Reply
"language" argument for certain functions
Latest comment:
3 hours ago
11 comments
4 people in discussion
Hello. I am relatively new to Wikifunctions. Recently, I tried to create functions for Chinese translation of
State location using entity and class (
Z26570
and
subject is kind of (Monolingual text) (
Z26095
(which became
Z32788
and
Z32900
). During the creation of these functions, I was trying to take
defining role sentence in S/T Chinese (
Z32212
as reference. And I realized that the defining role sentence function is taking
language
as an argument (and the test case of the Chinese-language function already contains two varieties of Chinese). This makes it possible to output monolingual text in
zh-hant
zh-hans
zh-tw
, or any varieties of the language. I think for this reason, it is better to have
language
as arguments for the implementation of Z26570 and Z26095, and potentially more functions that require
Configuration of functions for given languages (
Z14294
, since it would output the varieties code instead of just saying
zh
for
zh-hant
zh-hans
zh-tw
in the output of type
Monolingual text (
Z11
. I am not sure how the fallback mechanism works if one of the language (varieties) do not have a labels/lexemes, but to me, it is reasonable to have a
language
argument.
Sun8908
talk
09:38, 31 March 2026 (UTC)
Reply
The functions you mention do have a language argument. For Wikifunctions, the
Natural language (
Z60
can be at a higher or lower level; whether a
Monolingual text (
Z11
is for a language or a variant is determined by the function that constructs it. Please see
[“driving licence”(en-gb), …] ↤ Q205647 (
Z26565
for an example and feel free to add test cases in Chinese.
GrounderUK
talk
17:54, 11 April 2026 (UTC)
Reply
Hello @
GrounderUK
, thanks for the answer. I understand that whether
Monolingual text (
Z11
is for a language or a variant depends on the function. But that is exactly what I am asking for. It is true that
Z26570
and
Z26095
takes
Z60
as argument, but the language-specific functions in
config for state location using entity and class (
Z29843
and
config for article-ful instantiating sentences (
Z26096
don't.
Let me give you an example: INPUT to
Z26570
entity
: Tokyo,
class
: city,
location
: Japan,
language
: zh-cn, the config would select
Z33030
(created after my previous comment by elseone) as the implementation, and it would RETURN 东京是日本的一个城市。(zh-hans), which is not zh-cn as requested in the INPUT. It would also be using the term not for the variant (when it is different) because it is hardcoded to use the term in zh-hans. However, if we have the implementation like
Z32790
(which was created by me but a natural language argument was added by elseone) or
Z32213
(that works in the defining role sentence function because of the extra argument), it could cater for different variant.
If we don't have the language argument in the language-specific function, the desire for article creation on Abstract Wikipedia would be to create a function for every variant. Is it then better to create functions for every variant?
Sun8908
talk
18:18, 11 April 2026 (UTC)
Reply
I forgot to mention that there are some hardcoding in
State loc using entity and cls, zh, cmp (
Z32790
as well, but I cannot fix it because it is a connected function and I am not a functioneer.
Sun8908
talk
18:31, 11 April 2026 (UTC)
Reply
Okay, I think it’s safe to disconnect this one as the function is not yet configured for use on Abstract Wikipedia.
GrounderUK
talk
19:04, 11 April 2026 (UTC)
Reply
Ah, sorry… I misunderstood you. I agree that the called function should be able to accept the original language argument. That is simpler in theory than in practice, because the configured functions all have to have the same argument types, as I understand it. I’m not sure which the best approach is, really, but we probably want to avoid two levels of configuration. That suggests that all language-specific functions would need to accept the additional argument, which is unrewarding work for someone. @
99of9
, @
Jdforrester (WMF)
, @
DVrandecic (WMF)
Any thoughts?
GrounderUK
talk
18:57, 11 April 2026 (UTC)
Reply
I mean, we would need to modify all the functions in each language, which could take some time. But we are still in an early stage. If we don't fix it now and we want to fix it later, it would be a disaster.
Sun8908
talk
19:25, 11 April 2026 (UTC)
Reply
Agreed. And we probably want them converted to HTML too, with separate language spans for text in different languages.
GrounderUK
talk
19:35, 11 April 2026 (UTC)
Reply
GrounderUK
: This sounds like a reasonable change to make. Note that (given these Functions are primarily for use on Abstract Wikipedia), altering/replacing them to return Z89/HTML fragments is already a desired but breaking change, so making a second breaking change at the same time is probably easiest for fixing things swiftly. That said, that's of course a decision for the Abstract Wikipedia and Wikifunctions communities, not me!
Jdforrester (WMF)
talk
19:43, 12 April 2026 (UTC)
Reply
GrounderUK
Sun8908
to make it a non-breaking change, I've created
apply three or optionally four argument function (
Z34039
which allows a composition
state loc ent cla, compose apply3/4 args (
Z34043
. This way you can make functions which either need the specified variant or don't! --
99of9
talk
05:52, 24 April 2026 (UTC)
Reply
I have now created
state loc using entity and cls, compose, 4 args (
Z33465
, which is an implementation of
Z26570
. Maybe we can migrate to use that function when more (language-specific) functions for it are ready?
Sun8908
talk
18:19, 14 April 2026 (UTC)
Reply
Special:CreateObject doesn't let me create a typed list
Latest comment:
21 days ago
6 comments
3 people in discussion
Hello. I tried to create a typed list with all English varieties on Wikifunctions, to create consistency between different configs, but
Special:CreateObject
doesn't show typed list as an option for creating. Is this a bug or an intentional restriction?
ChaoticVermillion
talk
08:24, 2 April 2026 (UTC)
Reply
ChaoticVermillion
: A typed list is an instance of a function call, which is prohibited as a persisted Object. Maybe you want an enum? See
Wikifunctions:Type proposals
for the process for creating such a thing.
Jdforrester (WMF)
talk
12:01, 2 April 2026 (UTC)
Reply
I don't want any sort of enum for this, I just want a list of English varieties (English, American English, Australian English, etc.) as an object that I can put in configs. I tried making an object as a function call, but apparently I have to be a member of the staff to do it.
ChaoticVermillion
talk
12:07, 2 April 2026 (UTC)
Reply
I’ve started this with
English variants (
Z33034
. I’m guessing you were trying to create an object of type
Function call (
Z7
rather than an object whose type is a
Z7
. There’s a subtle but important difference.
GrounderUK
talk
12:29, 2 April 2026 (UTC)
Reply
How do you create a object whose type is a
Z7
then? I can't see any option to do this.
ChaoticVermillion
talk
12:32, 2 April 2026 (UTC)
Reply
When you are creating an object you must specify its type. By default, the UI expects you to provide a reference to the type, so you can just type in the selector box and click the type you want. For an object like a typed list, the type is specified as a function call, so you click the menu dots beside “type” and choose “function call” instead of “reference”. The selector now allows you to search for functions that can return a type object. You start entering “typed list” and select it in the normal way. Then the UI will allow you to specify the argument to the function call, which is the type shared by all elements in the list.
GrounderUK
talk
13:12, 2 April 2026 (UTC)
Reply
Unable to use the Z32643 function.
Latest comment:
21 days ago
3 comments
3 people in discussion
I'm trying to use the
Z32643
(Article-less multi instantiating fragment) function to edit an article in Abstract Wikipedia, but it looks like it's missing connected implementations, and it looks like i don't have the permissions to connect the function with the implementation and use it in ab.wiki.
Since i'm not familiar with Wikifunctions, i would like to get help for this specific problem.
Thanks. --
Mattiz6276
talk
13:50, 2 April 2026 (UTC)
Reply
Mattiz6276
: Hey there, it looks like that's a work-in-progress by @
MetalBreaksAndBends
. There's only a fall-back implementation, Z32652, which fails its own test for a second item. I can connect the items together but it might not work as you expect?
Jdforrester (WMF)
talk
14:06, 2 April 2026 (UTC)
Reply
Maybe… I don’t think functions without implementations should be appearing on AW so I have amended the label to avoid giving the impression that this function is available.
GrounderUK
talk
14:23, 2 April 2026 (UTC)
Reply
Being able to use edit summaries
Latest comment:
21 days ago
1 comment
1 person in discussion
I have wanted to use edit summaries a few times when connecting or disconnecting implementations or tests, and I have found that the only way to do that is to use the
wikilambda editsource
tool. I feel like it would be a lot more convenient to be able to make these edit summaries without having to use that tool.
ChaoticVermillion
talk
08:40, 3 April 2026 (UTC)
Reply
Definite forms
Latest comment:
20 days ago
1 comment
1 person in discussion
I've noticed an incomplete implementation and would like to work on fixing it, but need advice.
Ijon
talk
21:05, 3 April 2026 (UTC)
Reply
Wikifunctions & Abstract Wikipedia Newsletter #243 is out: Community proposals for capturing meaning
Latest comment:
13 days ago
1 comment
1 person in discussion
There is
a new update
for Abstract Wikipedia and Wikifunctions. Please, come and read it!
In this issue, we report on three community proposals on syntactic approaches, we introduce a new Type (Complex numbers), we report on current hiccups on Abstract Wikipedia, we share more information about a presentation about Abstract Wikipedia at WikiCon Australia, and we take a look at the latest software developments.
Want to catch up with the previous updates? Check
our archive
Also, we remind you that if you have questions or ideas to discuss, the next
Volunteers' Corner
will be held on
April 13, at 17:30 UTC
link to the meeting
).
Enjoy the reading! --
User:Sannita (WMF)
talk
15:35, 10 April 2026 (UTC)
Reply
Help me understand why test passes but running function with same input errors
Latest comment:
12 days ago
4 comments
3 people in discussion
I've been working on a function that I thought I had working correctly:
Western musical scale degree to Svara (
Z31108
):
Given the Wikidata item for a note (scale degree) in the Western music system, return the Wikidata item of the corresponding Svara from Indian classical music
It has a test which is passing, but when I enter the same Wikidata item as the test uses (or any other relevant item that it ought to work for), it errors. I can't figure out what's wrong (and the function itself seemed to be working as expected the last time worked on it, a month ago), and I don't know how to interpret the error info.
The error output is:
Error type: Unspecified error
Error data:
error information: "cannot read property 'Z6003K4' of undefined"
Execution debug logs:
Z12696K2 (find this) ==> ZObject
--
Ragesoss
talk
18:02, 10 April 2026 (UTC)
Reply
Hmm… I’ve had a quick look and found a comparable error with
P225 of Q277514 has certain P405 (
Z29937
, which was passing “4 months ago”. The debug comes from
contains, python (
Z12863
, after it fails to find a match. This is probably because Z6007K3 is ZReference("Z6021") rather than a Z6020 object, as it appears in the debug logs for your test “28 days ago”:
"Z6007K3":{"Z1K1":{"Z1K1":"Z9","Z9K1":"Z6020"},"Z6020K1":{"Z9K1":"Z6021"}}
This means it’s probably a bug introduced by a recent software change. I’ll take a closer look over the weekend, but the actual error for your test case now is:
Unspecified error (error information: "cannot read property 'Z6003K4' of undefined")
I’m guessing that’s from there being no guard against an empty array in
best claim from list, javascript (
Z23681
, but we’ll see.
GrounderUK
talk
23:22, 10 April 2026 (UTC)
Reply
I tracked down the bug to
Z29869
and fixed that, but the tests for
Z31659
are still failing.
YoshiRulz
talk
05:44, 11 April 2026 (UTC)
Reply
Thanks. I’ve re-implemented
best ranked statement from list (
Z23680
with
best ranked statement from list, JavaScript: error (
Z33331
so we at least get a meaningful error in
Western musical scale degree to Svara (
Z31108
. The new implementation explicitly caters for the alternative representation of
Wikidata statement rank (
Z6040
and errors on the empty list it gets from
get property statements with qualifier from item (
Z31659
I also made a
simple Python implementation
, which seems to work.
GrounderUK
talk
16:29, 11 April 2026 (UTC)
Reply
No place to ask to activate a function?
Latest comment:
7 days ago
9 comments
4 people in discussion
I just discovered the
English verb to agent noun (
Z11390
function and decided to make an overarching language-selecting function for it. After some fiddling around and studying how
X exists in N Ys (
Z32321
and its set works, I now have
verb to agent noun (
Z33439
which has a config object (
config for verb to agent noun (
Z33441
) that selects between the two preexisting language-specific versions I found (English and Malayalam) and the new one I created for my other native language,
Tagalog verb to agent noun (
Z33440
Except I can't get these to work, because, from what I understand, only
functioneers
can activate newly created functions and implementations?
So where do I apply for the
verb to agent noun (
Z33439
and
Tagalog verb to agent noun (
Z33440
functions to be activated? Perhaps we should have a place to ask for it, a la
w:WP:NPP
— call it
New Functions Patrol
if you will. —
Undue
Marmot
talk
08:58, 14 April 2026 (UTC)
Reply
There's
Wikifunctions:Community portal
for this. By the way,
Tagalog verb to agent noun, python (
Z33445
doesn't work because all the code must be inside the main function in Python code.
Dv103
talk
09:19, 14 April 2026 (UTC)
Reply
Huh. How could I have missed that?
But anyway, I've moved the code in
Tagalog verb to agent noun, python (
Z33445
into inside the main function block.
Is there any reason why WF decided not to simply allow anyone to write functions? After all, that's how it works with wikitext templates, and these functions are fundamentally serving the same purposes as templates, just written in a different way. —
Undue
Marmot
talk
11:25, 14 April 2026 (UTC)
Reply
I've fixed a couple of technical issues, but tests still fail.
Dv103
talk
11:28, 14 April 2026 (UTC)
Reply
The tests pass now after some more changes to the code:
Special:Diff/265232/cur
. —
Undue
Marmot
talk
12:01, 14 April 2026 (UTC)
Reply
Connected
Dv103
talk
12:02, 14 April 2026 (UTC)
Reply
I think it's a security issue, since Wikifunctions implementations could teoretically be malicious.
Dv103
talk
11:29, 14 April 2026 (UTC)
Reply
This ^^^. We're very lenient, though, once you've created a few working functions you can apply for the right, per
WF:Functioneer
Feeglgeef
talk
12:26, 14 April 2026 (UTC)
Reply
That explanation
doesn't add up
. A reason to limit
connection powers
to Functioneers might be to prevent vandalism, considering Functions can be used across wikis. But user-provided code is already being executed even without a Functioneer connecting it.
YoshiRulz
talk
20:01, 16 April 2026 (UTC)
Reply
Wikifunctions & Abstract Wikipedia Newsletter #244 is out: Milestones; Some major issues hopefully resolved
Latest comment:
6 days ago
1 comment
1 person in discussion
There is
a new update
for Abstract Wikipedia and Wikifunctions. Please, come and read it!
In this issue, we celebrate 4000 functions on Wikifunctions and 1000 abstract articles on Abstract Wikipedia, we announce that we should have fixed some major issues with the websites, we inform you on our latest outreach activities, and we take a look at the latest software developments.
Want to catch up with the previous updates? Check
our archive
Enjoy the reading! --
User:Sannita (WMF)
talk
10:22, 17 April 2026 (UTC)
Reply
Actual difference between
subject is instance of (string) (
Z26039
and
subject is kind of (Monolingual text) (
Z26095
Latest comment:
3 days ago
5 comments
3 people in discussion
What is the actual difference between these two functions? I ask, since it seems to me that the current distinction is more or less that the first one doesn't use an indefinite article in English, while the second does. Which is not a good distinction in a project that should be language neutral. This doubt emerged from my use of the first one in
abstract:Q124441
, which @
Hogü-456
made me notice that is probably wrong. My question is: why is it wrong? How could we clarify the difference?
Dv103
talk
19:46, 19 April 2026 (UTC)
Reply
I think the difference is if there is an indefinite article like a or an before the subject or not. In German there can be cases where a definite article is necessary before the subject. I looked at the functions and before the object both times an article is mentioned. As it depends on the language and the word what is the correct function to use I hope it will be clarified and it is an example of the necessity to have a human with understanding in a specific language check it. I hope there will be longer functions what generate more content about a specific kind of item. Then it is necessary to write one such function per language and it can be then applied to several items. It still requires checks and so maybe it is better to write down what item category needs what kind of introduction sentence function for what language.
Hogü-456
talk
20:05, 19 April 2026 (UTC)
Reply
The point of these two functions (and of the entire Abstract Wikipedia project) is that they should be defined in a purely language-independent way, so that the translation to actual language can be done automatically. This is the reason why these functions have been renamed; I think that this attempt was not succesful, since meaning is still unclear. My proposal to clarify them would be to invoke the concept of
specificity
subject is instance of (string) (
Z26039
should be named "specific subject is instance of (string)", and should be used only when the QID of the subject uniquely identifies a single thing;
subject is kind of (Monolingual text) (
Z26095
should instead be renamed in "non-specific subject is kind of (Monolingual text)", and should be used when the QID refers to a multitude of real life items, and we are specifying the class that all these item belong to. This clarification would not still be enough, since it doesn't explain how mass nouns are handled (is water a unique thing? Does
bread
(Q7802)
refer to a single piece of bread or to the entirety of bread, like water?). This problem is very tricky, since mass noun are language-specific and blurry the line between these two functions.
Dv103
talk
20:58, 19 April 2026 (UTC)
Reply
Simply put, one corresponds to P31 and the other to P279. Paris is an
instance of
(P31)
big city
(Q1549591)
whereas a
big city
(Q1549591)
is a
subclass of
(P279)
(alias “kind of”)
city
(Q515)
. Whether the Wikidata knowledge representation will be sufficient to resolve into fluent natural language representations in all languages is, of course, a crucial question. Where it is not, the Abstract Wikipedia knowledge representation will need to supplement the Wikidata content with additional details about the relation between the participants or the participants themselves, and these details should be language-neutral, to the extent that this is practicable. The item
washing machine
(Q124441)
has no
P31
statements; it has only
P279s
, including one relating it to
home appliance
(Q212920)
, which suggests
subject is kind of (Monolingual text) (
Z26095
is the appropriate choice here even if the rendering in some languages is the same.
GrounderUK
talk
22:52, 19 April 2026 (UTC)
Reply
Thanks for explaining it. I think that I'll change the implementation of
subject is kind of (Monolingual text) (
Z26095
, so that in Italian it produces more or less the same output of
subject is instance of (string) (
Z26039
(both with the definite article).
Dv103
talk
11:24, 20 April 2026 (UTC)
Reply
Equivalent of Z6830 for lexemes
Latest comment:
2 days ago
3 comments
2 people in discussion
Is there an equivalent of
Find lexemes for a Wikidata item (
Z6830
that enables retrieving all lexemes pointing to a particular lexeme using a specific property?
Redmin
talk
21:06, 20 April 2026 (UTC)
Reply
There's
Find lexemes for a Wikidata lexeme sense (
Z6831
but I think that's slightly different again to what you're after.
YoshiRulz
talk
12:31, 21 April 2026 (UTC)
Reply
Thanks for sharing that one, I did not know it existed. But you are right, it’s not quite what I am looking for. I want a function that would take a Wikidata property reference (like P5191, which is ‘derived from lexeme’) and a Wikidata lexeme reference, and return a list of lexemes that reference that lexeme using that property.
Redmin
talk
13:23, 21 April 2026 (UTC)
Reply
Storing huge datasets
Latest comment:
2 days ago
4 comments
3 people in discussion
It is not a necessity I suppose, but an idea came to me earlier to write a function that would give the corresponding
of an English word written with the Latin alphabet, or perhaps apply that operation to an entire sentence. However, just trying to guess as to what the IPA pronunciation of each word passed into it could be is is both not ideal (pronunciations obviously can and will vary widely between accents) and infeasible
(Wikidata lexemes don't really seem to account for pronunciation)
. It happens, though, that a comprehensive Shavian dictionary exists named the
Read Lexicon
, which uses pronunciation and spelling similar to that used by the creator of the alphabet himself. This would be a good dataset to use in performing this translation in the function, but it appears that, all in all, the total size of the dictionary is
nearly 26MB
when formatted as JSON, which would certainly be larger when converted into a typed list.
I am wondering if this will ever be feasible or admissible, or if there is really a way around this if importing such a large set of data is deemed impractical.
rae
5e
talk
22:30, 20 April 2026 (UTC)
Reply
Theki
"Wikidata lexemes don't really seem to account for pronunciation"" is patently untrue; not only does every Bokmål lexeme form have IPA attached to it (thanks to Jon Harald Søby), but there are lots of languages--including English--that have pronunciation information, whether through IPA or otherwise, indicated on their forms. The big issue of course is that adding this data is not always possible to perform efficiently--for instance, I'd love to have Yiddish pronunciation respellings from Paul Abelson's dictionary on as many English forms as possible, but this dictionary not being previously processed makes this difficult. The data set you have brought up, if a suitable reading of
m:Wikilegal/Lexicographical_Data
allows it, could be added as
pronunciation
(P7243)
statements on various English forms.
Mahir256
talk
23:20, 20 April 2026 (UTC)
Reply
Well, sorry... I haven't witnessed these pronunciation statements before, I wasn't aware of their existence until you pointed it out.
rae
5e
talk
15:02, 21 April 2026 (UTC)
Reply
I got 1,900,000 characters into
Z33875
before the UI gave up on me. I'm not sure what the limit is.
Feeglgeef
talk
15:21, 21 April 2026 (UTC)
Reply
Could not serialize input JS object: Number
[insert tested number here]
Latest comment:
18 hours ago
3 comments
3 people in discussion
I'm not one to throw my problems at others, but I have no idea how to fix this. Am implementing
parse JSON object to map (
Z24602
in JavaScript, which requires returning a typed map. It now works for every type of value except numbers. Tried explicitly converting the numbers to float64, but either way it throws the error above. Would appreciate it if anyone could diagnose or fix the problem, as my knowledge of Wikifunctions is amateur at best. Thank you.
Some helpful person
talk
00:32, 23 April 2026 (UTC)
Reply
The quick answer is that like some list-related functions, code implementations returning typed maps are not possible unless the type of the objects in the map is specified in the function signature (e.g. if it was a map from Strings to Natural numbers only). So unfortunately, I think you've chosen a function that is not really possible at the moment. There are a few ideas of how we might address this, but for the moment, work on something else. Sorry! --
99of9
talk
13:21, 23 April 2026 (UTC)
Reply
Maybe explicitly using
natural numbers
would work? I would try using
{ "Z1K1": "Z13518", "Z13518K1": "[number]" }
to represent numbers, perhaps, and seeing if that works. Of course, you would also probably have to adapt this for other types that cannot be serialized, and I'm not sure how easy that would be to generalize (assuming
DRYness
is desired).
rae
5e
talk
14:39, 23 April 2026 (UTC)
Reply
Help with creating a function for Abstract Wikipedia
Latest comment:
2 hours ago
15 comments
4 people in discussion
Hello! I was inspired by
State location using entity and class (
Z26570
to create
State origin using entity and class (
Z33975
, however I'm not sure how I add specific language implementations here. Can anybody help me?
QuickQuokka
talk
10:41, 23 April 2026 (UTC)
Reply
I think I figured it out, I created a new object with the language config type, added
select a function based on language (
Z14310
to my implementation, and added a new function for English... At least I think that's how it works...
QuickQuokka
talk
13:16, 23 April 2026 (UTC)
Reply
You have the right idea, as far as I know. I went ahead and connected the implementations you created as they appear to work fine for English, and added a test for
State origin using entity and class (
Z33975
(which passes
). I also corrected an error you made on the config object where you appear to have accidentally connected English to
State origin using entity and class (
Z33975
instead of
State origin using entity and class, English (
Z33977
. Thank you for contributing!
rae
5e
talk
13:45, 23 April 2026 (UTC)
Reply
Theki
Thank you so much for you help! Could you please kindly also connect the implementations for
Prepend Hebrew prefix (
Z33986
which I just made, which is going to be used for the Hebrew implementation of
State origin using entity and class (
Z33975
QuickQuokka
talk
14:11, 23 April 2026 (UTC)
Reply
You seem to be returning the wrong type in both implementations. Functioneers should not connect implementations that don't work for non-functioneers.
Feeglgeef
talk
14:13, 23 April 2026 (UTC)
Reply
Feeglgeef
Oh thank you for pointing that out! I am still a bit new to this project and confused, so I need to read up some more about this. How do I return a monolingual text object?
QuickQuokka
talk
14:17, 23 April 2026 (UTC)
Reply
I'm trying to fix it for you, the construction of ZObjects in code implementations is a bit difficult right now. Since the State origin using entity and class function will (presumably) be composition, perhaps
State origin using entity and class (
Z33975
can be adjusted to return a string, using
monolingual text from language and string (
Z26107
and
monolingual text from language and string (
Z26107
Feeglgeef
talk
14:21, 23 April 2026 (UTC)
Reply
I did not notice any discrepancies from looking at the functions by themselves, and it seemed to work fine on my end. Is it bad practice for NLG functions to return the monolingual text type? I had assumed it was logical.
rae
5e
talk
14:24, 23 April 2026 (UTC)
Reply
Both implementations are failing all three tests on my end. No consensus has been established as to whether monolingual texts or strings should be used, so it's like the
war of the currents
but for Wikifunctions.
Feeglgeef
talk
14:27, 23 April 2026 (UTC)
Reply
Oh, you were referring to
Prepend Hebrew prefix (
Z33986
. I assumed you were stating that something was wrong in the earlier English functions that I missed; I apologize for the misunderstanding. Has there been any centralized discussion on this string vs. monolingual text issue?
rae
5e
talk
14:31, 23 April 2026 (UTC)
Reply
Not that I'm aware of, I've brought it up on the telegram twice before, though.
Feeglgeef
talk
14:49, 23 April 2026 (UTC)
Reply
The centralised discussion is at
WT:Abstract Wikipedia/2025 fragment experiments#Proposed recommendation: Fragments should return Z11/monolingual strings
YoshiRulz
talk
07:19, 24 April 2026 (UTC)
Reply
Theki
and
Feeglgeef
Can only functioneers test implementations? For me I can't test it at all...
QuickQuokka
talk
14:32, 23 April 2026 (UTC)
Reply
AFAIK, test cases are only immediately testable during editing of a function if they are connected. This is one of my personal pain points with Wikifunctions, iterating on functions without exhaustive connected test cases makes debugging practically impossible for non-functioneers working on newly-created functions... I (or Feeglgeef) can quickly connect the tests you need for you if you want, although if they are not well-formed they may need to be disconnected again afterwards. Additionally, I could temporarily connect the implementation you are writing so that you can test it on the sidebar as you work, but I'm not sure if this is advisable. That functionality is also something that unfortunately only works when not disconnected.
rae
5e
talk
14:43, 23 April 2026 (UTC)
Reply
Yup, agree with you on all points, thanks.
Feeglgeef
talk
14:48, 23 April 2026 (UTC)
Reply
Please disconnect implementation
Latest comment:
12 hours ago
8 comments
2 people in discussion
I think I've fixed my issue with
Prepend Hebrew prefix (
Z33986
, but I can't edit an actively connected implementations with my rights. I must admit it is an AI-aided fix, I feel very strongly about disclosing that.
Courtesy pinging
User:Theki
and
User:Feeglgeef
QuickQuokka
talk
18:51, 23 April 2026 (UTC)
Reply
Additionally, I think the JS might be working.
QuickQuokka
talk
18:52, 23 April 2026 (UTC)
Reply
Just to clarify, I mean disconnect the Python implementation please.
QuickQuokka
talk
18:53, 23 April 2026 (UTC)
Reply
Done
I've disconnected the Python implementation.
I've also added a couple of tests. The rule is a bit more complicated than adding a maqaf before every character that is not a Hebrew letter. Unfortunately, I don't think I'll have time to fix the implementations any time soon.
Amir E. Aharoni
talk
19:03, 23 April 2026 (UTC)
Reply
Thank you!
Also, for some reason I thought you put a maqaf before all gershayim, so thanks for correcting me.
QuickQuokka
talk
19:09, 23 April 2026 (UTC)
Reply
No, that's not the rule.
The rest of this reply is an
infodump
, feel free to ignore it
:)
In
the Academy's punctuation rules
, the rule for adding a maqaf is written kind of badly: שמים מקף ברצף שיש בו שני סוגי גופנים, כגון אותיות ומספרים ("maqaf is added in a sequence in which there are two types of fonts, such as letters and numerals"). These are not different types of "fonts", but different types of characters, and I should email them about it. It gives the examples
ה־12
and
ב־DNA
. It doesn't say anything explicitly about quotation marks, but in other places on the same page, you have stuff like
ב"הארץ"
, and from that I deduce that a maqaf is not needed before double quotes if there are Hebrew letters inside the double quotes.
That said, a few people do think that there must be a maqaf before double quotes. I have a somewhat surprising example of somebody who always does it: translators of Scientology materials into Hebrew. At least that's what they did last time I looked at them, about ten years ago. Those people are certainly prolific, and they get points from me for consistency, but this not the prevalent standard. (And if I recall correctly, they use the minus and not the proper Hebrew maqaf, and they don't get any points from me for that!)
Also, the name of the character is just "double quotes" and not "gershayim". Gershayim are mostly for abbreviations, although most people use the same character for them. I use ״ for gershayim, as do a few other nerds, but we're the minority.
Amir E. Aharoni
talk
19:35, 23 April 2026 (UTC)
Reply
Amire80
Yeah, "font" is a weird choice of wording here by the Academy...
I think I'll follow your guidance and not use a maqaf for quotes beginning with Hebrew letters.
I should also add more tests for different types of quotes, like straight (", '), curly (“, ”, ‘, ’), gershayim (״, ׳), including single quotes.
P.S. gotta deduct points from Scientology for being a cult but that's neither here nor there
QuickQuokka
talk
20:49, 23 April 2026 (UTC)
Reply
Amire80
Courtesy ping because I mistyped your username on the last message. Anyways I'm also gonna do that tomorrow because I'm tired now...
QuickQuokka
talk
20:50, 23 April 2026 (UTC)
Reply
Retrieved from "
Category
Help
Wikifunctions
Project chat
Add topic
US