Wikifunctions:常见问题
本页解答与Wikifunctions相关的常见问题。若本页未能解答您的疑惑,欢迎前往讨论页发问。
Also, please consider our FAQ on Meta regarding more general questions about Wikifunctions and Abstract Wikipedia.
簡介
这个项目是关于什么的?
Wikifunctions是一个新兴的维基媒体项目,它提供了一个任何人都可调用、编写、维护和使用的多样化函数目录。该项目还提供了一种底层技术,它最终将能够把抽象维基百科(Abstract Wikipedia)中与语言无关的内容翻译成任何一种维基百科语言版本。这将让每个人都能用自己偏好的语言来贡献和阅读文章。
什么是函数?
函数是一种知识形态,能够回答问题,比如两个日期之间过去了多少天,或者两个城市之间的距离。更复杂的函数可以解答更复杂的问题,例如三维形状的体积,特定日期火星和金星之间的距离,或者两个物种是否在同一时间存活。
我们已经在许多类型的知识查询中使用了函数,例如向搜索引擎提问。英文维基百科上的模板,例如Template:Convert和Template:Age,也是一些已经在许多维基百科中使用的功能示例,这些功能是用wikitext和Lua编写的,并且需要手动复制到希望使用它们的每一个维基上。
什么是实现?
实现是执行函数的一种特定方式。实现是一个清单,列出了运行函数所需的步骤。它可能是编程语言中的一段代码,或是对其它函数调用的组合。一个函数可能有多个实现,这些实现应当都是等效的。
什么是测试?
测试是一种确定给定函数是否正常工作的方法。一个函数通常会有多个测试,每个测试都会指定一些输入到该函数以及给定输入的输出必须满足的条件。
For example, testers for a “title case” function might include: “abc” should become “Abc”; “war and peace” should become “War and Peace”; “война и мир” should become “Война и мир”; and “123” should remain “123”.
Which features are available now, which will be soon available, and which are further away?
- At launch:
- We have the ability to have functions that work with Strings and Booleans.
- Wikifunctions will be fully internationalized from the beginning. It can be used in any language.
- Ongoing development:
- Generic types and generic functions are not fully supported.
- Adding types will, for now, be something that is limited to the development team. In the future, the community will be able to add more types. There is a lot of work to be done in the future to make types behave much more smoothly.
- One particularly interesting type will be binary data, and particularly files.
- We currently support two programming languages for implementations: JavaScript and Python. In the future, we want to support many more.
- Currently, it is not possible to call other functions from implementations written in any programming language. This is currently only possible through composition.
- In the future:
- It will be possible to call Wikifunctions functions from other Wikimedia projects and integrate their results into the output of the page.
- It will be possible to use data from Wikidata in functions.
- It will be possible to call data sets from Commons Data namespace.
How is Wikifunctions multilingual?
Wikifunctions and Abstract Wikipedia are multilingual in a number of different ways which do not impact each other:
- Wikifunctions is multilingual in terms of its content and user interface. Users can read and call functions on Wikifunctions in any natural language. Here is the “join string” function in English, Polish, and Hebrew, and it is available in many more languages.
- Contributors can edit and improve Wikifunctions using their language. Even implementations can be edited in the natural language of the contributor. For example, the composition of the “and” function can be edited in German, English, or any other of about 300 languages.
- Wikifunctions functions can be used to create results for any natural language. The community is creating a growing number of functions to support the generation of text in many natural languages. We have functions for Breton, Rohingya, English, and many other languages.
- Functions in Wikifunctions can be implemented in various different programming languages. For example, the join function is implemented in both JavaScript and in Python.
Which programming languages does Wikifunctions currently support? Which programming languages will be supported in the future?
Currently, Wikifunctions supports implementations written in JavaScript and Python. We plan to add support for more programming languages in the future. We hope to add at least one further programming language in 2024 (but have not yet decided which one).
How will Wikifunctions be integrated into other projects?
Wikifunctions is the first step towards building Abstract Wikipedia. Our near-term focus will be on supporting the community and making improvements based on feedback. Concurrently, we will begin the process of integrating it with Wikipedia and Wikidata, which will enable broader real-life applications and get us closer to the vision of Abstract Wikipedia.
Contributors will be able to call functions stored on the Wikifunctions site from within their wikis. The result of the function call will be displayed to readers of the wiki. This can be used, for example, to calculate the age of a person, the population density based on population and area data from Wikidata, or to draw a graph and integrate it into a given article.
Another option to integrate Wikifunctions will be to integrate an interactive function call interface within their wiki. This could be used, for example, in a Wikipedia article to dynamically calculate the result of a physical equation based on reader-provided parameters, draw and interact with mathematical functions, etc.
维基函数不是什么?
具体请见Wikifunctions:What Wikifunctions is not。
这些函数将使用什么许可协议?
Per the discussion happened on Meta between November and December 2021, all contributions to Wikifunctions and the wider Abstract Wikipedia projects will be published under free licenses. In particular:
- 维基函数的文本内容使用CC BY-SA 4.0协议。
- 函数签名和其它结构化数据采用CC 0许可协议发表。
- Code implementations in Wikifunctions will be published under the Apache 2 license.
- Abstract Content for Abstract Wikipedia will be published under CC BY-SA 4.0.
There are still some points that will need to be addressed in the future, such as the license of the generated content from the abstract content. We plan on drafting a more comprehensive document with the Legal department about how people can re-use code from Wikifunctions as painlessly as possible, while adhering to the license.
作出贡献
I'm new here. What is there for me to do and how can I help?
Welcome! We're very happy to have you here! There are many opportunities for contributing to Wikifunctions, from creating new functions to improving and translating documentation. If you are looking for ways to get involved, we recommend that maybe, depending on your level of comfort, you suggest a new function on a topic you are interested in. Or even create such a function. Provide some tests. Try your hand at an implementation. Help with translations. Read and improve our documentation. Help with organizing the community.
How do I create a new function, implementation, or test?
To see how to create a new function, implementation, or test, see Wikifunctions:Introduction.
To see in more detail how to create an implementation, see Wikifunctions:How to create implementations.
What should I edit first?
If you can write several languages, find functions that don't have labels and descriptions in your languages yet, on Special:ListMissingLabels, and help to add them.
If you have some interest in a domain that could feature functions in Wikifunctions, but yet doesn't, or if you have more ideas for functions, go to the page for suggesting new functions, and present your ideas.
If you are a coder in JavaScript or Python, maybe you want to check for functions that don't yet have implementations in JavaScript or Python, and try to write them.
Where can I go for help?
Your first stop should be the Help portal where you'll find all the documentation related to using and editing Wikifunctions. If you're still stuck, post a message on Project chat, and someone will answer your question.
如何进行分类工作?
For now, the best way to sort or categorize functions is doing it by hand through pages in the Wikifunctions namespace. Another option would be through the talk page of the given function. We will monitor these efforts, and discuss with the community which changes to the system would be helpful for this task.