Hi Louis,

yes, you are right, but I want to point out that plural was not defined as plural: string ➝ string but as plural: English noun ➝ string. So the question is, what is English noun - and if that in turn was a wrapper object around Wikidata Lexemes, say L3337, it would indeed be rather easy to ask for the plural and get back "men" as a string.

Yes, one question is what does it mean to be side-effect free. If for example we define that calls to Wikidata can be considered side-effect free, as they are basically calls to a static(-ish) knowledge base, we got that fixed. That is also needed for many of the other example functions. The problem in that case is how much caching can we get away with.

So if we assume that Wikidata is available as a knowledge base for the functions, then I think that all the functions offered in the examples should be fine.

What do you think?

Thanks,
Denny





On Wed, Jul 22, 2020 at 8:28 AM Louis Lecailliez <louis.lecailliez@outlook.fr> wrote:
Hi Denny,

while a lot of functions make sense while we stay in the software realm, I'll note again that the ones concerning language have way too simplified signature to fullfil their role.

For example
* plural: English noun ➝ string
is gonna work as a pure function if and only if every irregular plural forms of English (stuff like man/men) are hardcoded into the function itself; and I think we all agree that's not a good engineering practice.
* plural: English noun, Dictionary<string, string> ➝ string
would be a more appropriate signature here, conceptually a least. In reality, data will be pulled from Wikidata (if I'm not mistaken), which mean the function has side effect and is not pure. It seems the problematic of access to the data layer (whatever it is) is underspecified.

I think it would be better to remove language generation signatures for the time being to not give the impression the problem space is trivially solvable by a function or two.

Best regards,
Louis Lecailliez


De : Abstract-Wikipedia <abstract-wikipedia-bounces@lists.wikimedia.org> de la part de Denny Vrandečić <dvrandecic@wikimedia.org>
Envoyé : mercredi 22 juillet 2020 14:30
À : Abstract Wikipedia list <abstract-wikipedia@lists.wikimedia.org>
Objet : [Abstract-wikipedia] A few examples of functions
 
Hello all,

I made a draft of possible function examples. I am not saying all of these are useful, or we will have these, or that these are the right signatures for the suggested functions, but this is more to illustrate the possible scope of the project we are aiming for.


Feel free to add, discuss, improve.

Stay safe,
Denny

_______________________________________________
Abstract-Wikipedia mailing list
Abstract-Wikipedia@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/abstract-wikipedia