Jump to content

Wikifunctions:Catalogue

From Wikifunctions

This is a guided list of example functions provided. See also the complete list of functions and Wikifunctions:Suggest a function.

Logic operators

These are the fundamental tools to control flow in your functions.

Boolean operations

These are the basic blocks from which to build logic states.

Boolean pairwise functions

2 nullary Boolean functions
Name ZID Value
nullary false nullary false (Z10206) F
nullary true nullary true (Z10210) T
4 unary Boolean functions
Name ZID F T
unary false unary false (Z10214) F F
identity Boolean identity (Z10215) F T
not not (Z10216) T F
unary true unary true (Z10217) T T
16 binary Boolean functions
Name ZID F ∗ F F ∗ T T ∗ F T ∗ T
binary false binary false (Z10257) F F F F
and and (Z10174) F F F T
not (A → B) not boolean implication (Z10962) F F T F
A Boolean Left (Z10265) F F T T
not (B → A) not backwards Boolean implication (Z10964) F T F F
B Boolean Right (Z10298) F T F T
xor Boolean inequality (Z10237) F T T F
or or (Z10184) F T T T
nor nor (Z10231) T F F F
xnor/eqv Boolean equality (Z844) T F F T
not B Boolean Not Right (Z10306) T F T F
B → A backwards Boolean implication (Z10348) T F T T
not A Boolean Not Left (Z10272) T T F F
A → B Boolean implication (Z10329) T T F T
nand nand (Z10243) T T T F
binary true Binary True (Z10287) T T T T

Sign operations

String operations

String evaluation operations

These functions perform simple tests on a text string to tell you if something else needs to be done, or they already are in an expected format.

String comparison operations

String discard functions

String character discard functions

These reduce a string by discarding certain characters.

Simple String transformations

These perform character replacements and other basic operations.

Replace suffix

Add string suffix if not already present

Other transformations

String presentation transformations

Uncommon String operations

These functions perform more advanced transformations, hold more states and showcase the more advanced capabilities of Wikifunctions.

String classical cipher functions

(alphabet needs to be specified when calling these functions)

Cryptographic hash functions

(would be better with types representing a stream of bytes)

Experimental String operations

TODO: Explain why these exist and when people might use them.

Wikitext string operations

  • italicise a simple string in Wikitext (Z11019): wrap string with two pairs of single quotes (ABC -> ''ABC''). Careful using this if your text has special formatting characters.
  • bold in Wikitext (Z11139): bold a string by triple quoting, e.g. (ABC -> '''ABC'''). Careful if there are special characters.
  • csv record to wikitable row (Z10919): Converts a validly formatted (RFC 4180) comma-separated value series into the contents of a valid wikitable row (not including the row start or row end characters) where variables are separated by '||', and any whitespace is unchanged. Be careful to validly render CSV with quoted fields and with pipes ('|') in the field.
  • wrap with XML tag (Z11156): adds <tag> and </tag> around a string

Scientific string operations

Comma-separated operations

  • string is element of CSV (Z11094): tests whether a string is an element of a validly formatted (RFC 4180) comma-separated value series (single row, not whole file); be careful to validly interpret a CSV with quoted fields

Natural language operations

See context in m:Abstract Wikipedia/Updates/2023-09-08.

global language functions

Bangla

  • bangla grapheme split (Z10587): Split all the graphemes in a given string in Bangla
  • genitive case of Bangla word (Z10591): Returns the genitive case of a Bangla word
  • Sadhu → Cholito: convert classical to standard Bengali (Z11077): সাধু ভাষার কোনো লেখাকে চলিত ভাষায় রূপান্তর করে
  • is Bangla word (Z12678): Check if the given word is written in Bangla
  • Is or has Bengali character (Z12892): Returns yes if the input string contains any bengali character or alphabet
  • Is Bangla Vowel or Consonant (Z12919): Returns is the string is a Bangla vowel, consonant or a mixture of both.
  • Gregorian to Bangla (Z12926): Returns the Bangla equivalent date of a Gregorian date format. The input fields represent the Year, month, and day, respectively.
  • Bangla conjunct vowel separation (Z13151): Separates conjunct vowels from consonants, returning the consonants and vowels separately.
  • Bangla matra (diacritic) type (Z13156): Returns the type of matra present in the input string. If the input contains multiple types of matras, it returns 'Mixed'.
  • Bangla consonant type (articulation point) (Z13195): ইনপুটে উপস্থিত ব্যাঞ্জনবর্ণ গুলোর উচ্চারণের স্থান অনুযায়ী তাদের বর্ণের প্রকার প্রদর্শন করে, গননা সহিত। যদি স্পর্শবর্ণ তাহলে ধ্বনির প্রকারও গননা করতে সক্ষম।
  • Bangla consonant type (pronunciation) (Z13238): উচ্চারণ রীতির বৈশিষ্ট্য অনুযায়ী, ইনপুটের ব্যঞ্জনবর্ণ গুলোর প্রকার ও তাদের গননা প্রদর্শন করে
  • Bangla vowels type (Z13270): ইনপুটে উপস্থিত স্বরবর্ণের ধরণ যাচাই ও গননা করে, উচ্চারণ অনুসারে। কোনো ব্যাঞ্জনবর্ণ গননা করবে না, সেটার জন্য দেখুন Z13238।
  • contains all characters of Bengali alphabet (Z14260): similar to is pangram (English) Z12626
  • Bengali cardinal (Z16150): Converts a natural number to a Bengali text string
  • Bengali text to cardinal (Z16904): কোনো সংখ্যার কথায় লেখা রূপ ইনপুট নিয়ে অঙ্কবাচক রূপ ফেরত দেয়।
  • Caesar cipher (Bengali Consonants) (Z17526): বাংলা বর্ণমালার ব্যঞ্জনবর্ণ গুলিকে একটি নির্দিষ্ট সংখ্যক স্থান দ্বারা এগিয়ে নিয়ে যাবে
  • Caesar cipher (Bengali alphabets) (Z17530): বাংলা বর্ণমালা (ব্যঞ্জনবর্ণ এবং স্বরবর্ণ উভয়) গুলিকে একটি নির্দিষ্ট সংখ্যক স্থান দ্বারা এগিয়ে নিয়ে যাবে।
  • Bengali to braille (India) (Z17563): বাংলা পাঠ্যকে ব্রেইল লেখায় রূপান্তর করবে, ভারতের পদ্ধতি অনুযায়ী। বাংলাদেশের প্রচলিত পদ্ধতিটির জন্য দেখুন 'Z17564' । আরও জানুন, w:bn:বাংলা ব্রেইল।
  • Bengali to braille (Bangladesh) (Z17564): বাংলা পাঠ্যকে ব্রেইল লেখায় রূপান্তর করবে, বাংলাদেশের পদ্ধতি অনুযায়ী। ভারতের প্রচলিত পদ্ধতিটির জন্য দেখুন 'Z17563' । আরও জানুন, w:bn:বাংলা ব্রেইল।

Brahui

Breton

General

For Breton nouns

Compositions
ending soft hard aspirant
Breton plural in -où and soft mutation (Z11637) Breton plural in -où and hard mutation (Z11660) Breton aspirant plural in -où (Z11663)
-ioù Breton plural -ioù and soft mutation (Z11786) Breton plural in –ioù with hard mutation (Z12281) Breton aspirant plural in -ioù (Z12284)
-ed Breton plural in -ed and soft mutation (Z12288) Breton plural in -ed and hard mutation (Z12291) Breton plural in -ed and aspirant mutation (Z12295)
-ien Breton plural in -ien and soft mutation (Z12298) Breton plural in -ien and hard mutation (Z12301) Breton plural in -ien and aspirant mutation (Z12305)

For Breton verbs

Breton conjugation
Person Indicative Conditional Imperative
Present Imperfect Preterite Future Present Past
1st singular Breton conjugation present 1st person singular (Z12320) Breton conjugation imperfect 1st person singular (Z12366) Breton conjugation preterite 1st person singular (-is) (Z12448)
Breton conjugation preterite 1st person singular (-jon) (Z12451)
Breton conjugation future 1st person singular (Z12342) Breton conjugation present conditional 1st person singular (Z12528) 1st person singular past conditional conjugation in Breton (Z12551) NA
2nd singular Breton conjugation present 2nd person singular (Z12323) Breton conjugation imperfect 2nd person singular (Z12369) Breton conjugation preterite 2nd person singular (Z12454) Breton conjugation future 2nd person singular (Z12345) Breton conjugation present conditional 2nd person singular (Z12533) Breton conjugation past conditional 2nd person singular (Z12554) Z
3rd singular Breton conjugation present 3rd person singular (Z12326) Breton conjugation imperfect 3rd person singular (Z12372) Breton conjugation preterite 3rd person singular (Z12457) Breton conjugation future 3rd person singular (Z12348) Breton 3rd person singular present conditional form (Z12536) Breton conjugation past conditional 3rd person singular (Z12557) Z
1st plural Breton conjugation present 1st person plural (Z12330) Breton conjugation imperfect 1st person plural (Z12375) Breton conjugation preterite 1st person plural (Z12460) Breton conjugation future 1st person plural (Z12357) Breton conjugation present conditional 1st person plural (Z12539) Breton conjugation past conditional 1st person plural (Z12560) Z
2nd plural Breton 2nd person plural present tense (Z12333) Breton conjugation imperfect 2nd person plural (Z12378) Breton conjugation preterite 2nd person plural (Z12463) Breton conjugation future 2nd person plural (-oc'h) (Z12351)
Breton conjugation future 2nd person plural (-ot) (Z12354)
Breton conjugation present conditional 2nd person plural (Z12542) Breton conjugation past conditional 2nd person plural (Z12563) Z
3rd plural Breton conjugation present 3rd person plural (Z12336) Breton conjugation imperfect 3rd person plural (Z12381) Breton conjugation preterite 3rd person plural (Z12466) Breton conjugation future 3rd person plural (Z12360) Breton conjugation present conditional 3rd person plural (Z12545) Breton conjugation past conditional 3rd person plural (Z12566) Z
0 Breton conjugation present person 0 (Z12339) Breton conjugated form (Z12384) Breton conjugation preterite person 0 (Z12469) Breton conjugation future person 0 (Z12363) Breton conjugation present conditional person 0 (Z12548) Breton conjugation past conditional person 0 (Z12569) NA

TODO: conjugated form in 4 mutations

Croatian

The percentages in the table, if given, state for how many of the lexemes in Wikidata the functions are correct. The percentages have been calculated using the this Paws Notebook.

regular inflections of nouns
feminine masculine neuter
case singular plural singular plural singular plural
nominative 100% 95% 98% 50% 100% 85%
genitive 97% 82% 83% 63% 88% 74%
dative 91% 95% 81% 47% 88% 85%
accusative 95% 94% 79% 53% 94% 85%
vocative 85% 95% 44% 49% 95% 85%
locative 90% 94% 82% 47% 88% 85%
instrumental 88% 94% 66% 47% 85% 85%
regular inflections of adjectives
positive definite feminine masculine neuter
case singular plural singular plural singular plural
nominative Z12578
genitive Z12587
dative
accusative animate
inanimate
vocative
locative
instrumental
positive indefinite feminine masculine neuter
case singular plural singular plural singular plural
nominative
genitive
dative
accusative animate
inanimate
vocative
locative
instrumental
comparative feminine masculine neuter
case singular plural singular plural singular plural
nominative
genitive
dative
accusative animate
inanimate
vocative
locative
instrumental
superlative feminine masculine neuter
case singular plural singular plural singular plural
nominative
genitive
dative
accusative animate
inanimate
vocative
locative
instrumental

Dutch

English

Esperanto

Finnish

French

German

(These generally correspond to more than one form.)

Hindustani

Verb

Igbo

Japanese

  • is hiragana (Z10878): Given a single-character string, returns boolean for whether it is an hiragana or not.
  • is katakana (Z10883): Given a character, returns boolean for whether it is a katakana or not.
  • is Han character (Z10927): Given a character, returns boolean for whether it is a Han character (hanzi, kanji, hanja) or not.

New Persian

Considering together Iranian, Afghan, and Tajik Persian or Dari in the Arabic or Cyrllic scripts.

Noun

Korean

Hangul

Polish

  • Polish cardinal (Z15965): перетворює число на його текстову форму польською мовою

Punjabi

Missing functions will be filled in as they are completed.

Nominal

  • masculine direct case plural, oblique case singular
  • masculine oblique case plural
    • Gurmukhi ā > iā~
    • Shahmukhi ā > iā~
  • masculine oblique case plural (perfect participle)
    • Gurmukhi ā > iā~/e
    • Shahmukhi ā > iā~/e
  • masculine vocative case singular
    • Gurmukhi ā > iā
    • Shahmukhi ā > iā
  • masculine vocative case plural
    • Gurmukhi ā > io
    • Shahmukhi ā > io
  • masculine ablative
    • Gurmukhi ā > io~
    • Shahmukhi ā > io~
  • feminine direct case plural, oblique case plural
    • Gurmukhi +ā~
    • Shahmukhi +ā~
  • feminine vocative case singular
    • Gurmukhi +e
    • Shahmukhi +e
  • feminine vocative case plural
    • Gurmukhi +o
    • Shahmukhi +o
  • feminine ablative
    • Gurmukhi +o~
    • Shahmukhi +o~

Verb

  • common forms
    • gerund
    • conjunctive participle
    • absolute construction
    • potential participle
    • imperfect participle
      • Pothohari forms in -n-
    • perfect participle
    • subjunctive
    • imperative
  • subtractive phase
    • imperfect participle
  • Charhdi definite subjunctive
    • colloquial first person singular, third person singular
    • gendered personal series
  • Lehndi future
  • Lehndi passive
    • passive gerund
    • imperfect passive participle
    • impersonal passive
    • Jatki + Shahpuri passive subjunctive
    • Jatki + Shahpuri passive future

Rohingya

General

Noun

The ergative case function can serve as one for the instrumental case where applicable.

Serbian

Sindhi

Noun

Swedish

See draft functions.

Turkish

Ukrainian

List operations

Basic list/iterable functions

Complex list/iterable functions

Functions with list outputs

Python and JavaScript implementations can currently only generate lists of objects (other than string/boolean) when the type of the list is pre-specified by the function specification. Hence these functions may need a variant for each type.

Character operations

Natural number operations

Numeric Characteristics

Comparisons

Selections

Arithmetic Functions

Natural number sequences and unary natural number functions

See Wikifunctions:OEIS

Bitwise Functions

Number conversions

Integer functions

Integer functions using set-theoretic representation with pairs of natural numbers

see w:Integer#Equivalence classes of ordered pairs

Integer sequence and unary integer functions

See Wikifunctions:OEIS

Number operations requiring future types

Types such as floating point or negative integers would benefit these functions.

Numeric Characteristics

Arithmetic Functions

Trigonometric Functions

Health Functions

Geometric Functions

  • (!) linear interpolation (Z13341): one dimensional linear interpolation given points a,b and input t (0,1) see: https://en.wikipedia.org/wiki/Linear_interpolation for attribution

Randomness

Reminder that Wikifunctions does not support randomness for now. We always expect all functions to return functional, deterministic results, only dependent on the input. This is in order to allow for aggressive caching. see Wikifunctions:Project_chat/Archive/2023/09#Help_please.

Day of the week

Month operations

Gregorian months

Igbo months

Date operations

Persistent object operations

Note that there are currently some bugs in the handling of persistent objects, especially in tests. See [1]

Generic object operations

Note that due to handling all types of objects, most of these functions have bugs

  • Echo (Z801): returns the argument unchanged
  • Value by key (Z803): returns the value (Object) associated with the specified Key reference
  • Values by keys (Z804): returns the values (Object) associated with the specified list of Key references
  • Reify (Z805): Returns a list of key-value pairs representing the object given
  • Abstract (Z808): Takes a list of key-value pairs representing an object and returns the corresponding object
  • object equality (Z13052): takes two objects as arguments and tests if they are exactly equal including same type representation (when mapped to python) and their types have an unambiguous concept of equality
  • object type equality (Z15801): returns True if two objects are of the same type

Type handling

Functional operations

Note that functions as argument or return types are not fully supported yet. See [2]

See also