Wikifunctions:Catalogue
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.
- If (Z802): depending on whether the condition is true will return one or the other value
- if (string output) (Z11542): if function (like Z802) typed with string types
- if (natural number output) (Z13846): if function (like Z802) typed with number types
Boolean operations
These are the basic blocks from which to build logic states.
- not (Z10216): takes a truth value and returns its opposite
- and (Z10174): Performs a Boolean and operation
- or (Z10184): Performs a Boolean OR operation
- Boolean equality (Z844): returns true only if both inputs are equal
- Boolean inequality (Z10237): returns true only if both inputs are different
Boolean pairwise functions
Name | ZID | Value |
---|---|---|
nullary false | nullary false (Z10206) | F |
nullary true | nullary true (Z10210) | T |
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 |
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 |
- and (quaternary) (Z11828): takes four boolean inputs and returns true if and only if they are all true
- are all true (Z12684): returns true if every list item is true
- is any true (Z12698): checks whether in a list of Boolean any is true
- are all false (Z13445): returns true if every list item is false
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 length (Z11040): Return the length of this string
- is empty string (Z10008): true if the input string is strictly empty, even without any non-printing characters, and false otherwise
- is string blank (Z10083): Checks if a string just contains whitespaces
- is numeric (Z10715): Checks if a string contains only numeric characters
- is uppercase (Z10336): checks if string is uppercase (equal to its own uppercase - so blanks and empty strings count)
- has and is uppercase (Z11349): checks if string has and is uppercase (blanks and strings without letters don't count)
- is lowercase (Z10346): checks if string is all lowercase
- has and is lowercase (Z11383): checks if string has and is lowercase (blanks and strings without letters don't count)
- is title case (Z10375): checks if string is in title case
- is pascal case (Z10363): checks if string is in pascal case
- is camel case (Z10897): true if the entered string is in camel case (e.g. 'camelCase')
- is snake case (Z10324): checks if string is in snake case
- fallback if string is empty (Z11082): returns a fallback string if the value is empty, and the value itself if not
- has specified chars paired (Z11678): check if a string has correctly paired chars (for example: brackets). Specifying left and right chars (brackets) in sequence)
- has all brackets paired (Z11684): check for pairing of all possible left-right paired characters, feel free to extend
- is pangram (Latin alphabet) (Z12626): checks whether a string of characters possesses every letter from the Latin alphabet at least once
- is a palindrome (Z10096): test if a string is the same when read forward and backward (see Z10553 for one with Unicode grapheme support)
String comparison operations
- string equality (Z866): True if the first string and the second string are the same
- case-insensitive string equality (Z10539): returns true if both strings are the same if converted to lowercase
- string inequality (Z10379): true if two text strings are not exactly equal
- substring exists (Z10070): Check if a substring exists within another string
- string starts with (Z10615): returns true if the substring exists at the beginning of the string
- string ends with (Z10618): true if the substring exists at the end of the string
- strings equal length (Z11690): checks if the two input strings are of equal length
- longer string (Z11519): Returns the longer of two strings. If equal, defaults to returning the first.
- string only has characters from alphabet (Z11693): check if all of the characters in the tested string are from the alphabet string
- is pangram of alphabet (Z13119): check if the string uses every letter of a specified (lowercase) alphabet
- is anagram (simple) (Z10973): test if the same characters at the same number of times are used in two strings (characters must be exact code points).
- is ISO 639-1 language code (Z13482): validates whether a string is a valid ISO 639-1 language code
String discard functions
- discard from start of first substring (Z11410): if the substring is found in the full string, discard everything after and including the first occurrence, otherwise leave unchanged
- discard from end of first substring (Z11412): if the substring is found in the full string, discard everything after but not including the first occurrence, otherwise leave unchanged
- discard until start of first substring (Z11418): if the substring is found in the full string, discard everything before but not including the first occurrence, otherwise leave unchanged
- discard until end of first substring (Z11420): if the substring is found in the full string, discard everything before and including the first occurrence, otherwise leave unchanged
- discard from start of last substring (Z11414): if the substring is found in the full string, discard everything after and including the last occurrence, otherwise leave unchanged
- discard from end of last substring (Z11416): if the substring is found in the full string, discard everything after but not including the last occurrence, otherwise leave unchanged
- discard until start of last substring (Z11422): if the substring is found in the full string, discard everything before but not including the last occurrence, otherwise leave unchanged
- discard until end of last substring (Z11424): if the substring is found in the full string, discard everything before and including the last occurrence, otherwise leave unchanged
- remove at end (Z11170): if a string ends with the given suffix, remove the suffix, otherwise return the string unchanged
String character discard functions
These reduce a string by discarding certain characters.
- remove regular spaces (Z10052): remove all regular spaces (U+0020) from a string
- Trim String (Z10079): Remove starting and ending whitespaces
- remove characters in character range (Z11531): strips all characters from a codepoint block from a string
- remove interpunction (Z11193): remove all interpunction characters
- remove last character (Z11879): renvoie la chaîne de caractères sans le dernier caractère
- remove all characters except ASCII digits, uppercase Latin letters and lowercase Latin letters (Z10171): 文字列から半角英数字以外の文字を除去する
Simple String transformations
These perform character replacements and other basic operations.
- join two strings (Z10000): combine two strings, one after the other
- reverse string (Z10012): Inverts the order of the characters in a String (see Z10548 for one with Unicode grapheme support)
- To Uppercase (Z10018): Convert a string to uppercase letters
- To Lowercase (Z10047): Convert a string to lowercase letters
- replace all substrings (Z10075): finds and replaces all instances of a substring in an input string
- wrap string (Z11145): add wrapper text to the start and end of a string
- unwrap string (Z11151): removes text from start and end of string once only if both are present
- duplicate string (Z10753): takes a string and returns it duplicated
- regular expression substitute with flags (Z12316): $N for capture groups. Flags supported should at least be 'i', 'm', and 'g'.
- replace all (regex, case sensitive) (Z10193): replace characters in a string with another string according to a regex pattern
- to Title Case (Z10251): converts a string to title case
- to PascalCase (Z10290): convert string to Pascal Case
- to camelCase (Z10816): convert string to lower camelCase,
- to snake_case (Z10281): convert string to snake case
- string to hex (UTF-8) (Z10366): convert string of UTF-8 characters into hexadecimal
- hex (string) to string (UTF-8) (Z10373): hex to string
- unicode of first character (Z11515): Python ord() function. Return the natural number that represents the (single/first) character input.
- URI percent encode (Z10761): encodes certain characters using URI percent encoding syntax
- URI percent decode (Z10774): decodes a percent-encoded input string
- international morse code encode (Z10944): encodes the supplied string in morse code, separating letter encodings by spaces and words by " / "
- international morse code decode (Z10956): decodes the supplied string in morse code: separate letter encodings by spaces and words by " / "
- encode NATO phonetic alphabet code (Z10309): requires ALLCAPS input, e.g. EXAMPLE
- decode NATO phonetic alphabet code (Z10970): case insensitive
- get first character of string (Z10901): returns the first character of a string
- get last character of string (Z11060): returns the last character of a string
- replace at end (Z11178): replaces suffix with replacement if input ends with suffix; if not, returns input unchanged
- pretty " (Z11484): replace " with pretty left-right quotes depending on position
- pretty ' (Z11490): replace ' with pretty left-right quotes depending on position
- Mix colours (Z12997): This calculates colour mixtures, returning hexadecimal results. It prefers input in hexadecimal but also accepts basic colour names.
- convert hex color (Z13017): converts a hexadecimal color code into HSL, HSV, RGB, and CMYK formats
- opposite color (Z13023): in the RGB color space
- color contrast ratio (Z13028): returns color contrast ratio 'X:1' for given hex colors
- Infix to Postfix (Z13060): converts infix operators and operands to postfix format
- format large natural number strings by adding commas (Z13473): অনেকগুলো অংক রয়েছে এমন স্বাভাবিক সংখ্যায় কমা যোগ করে সাজায়।
Uncommon String operations
These functions perform more advanced transformations, hold more states and showcase the more advanced capabilities of Wikifunctions.
- left/inner/right mark replacement (Z11492): replaces the same mark (or substring) in a string with different replacements depending on position
- general positional mark replacement (Z11501): a generalisation of Z11492 to allow different spacers and specify isolated replacement
String classical cipher functions
(alphabet needs to be specified when calling these functions)
- Caesar cipher (Latin alphabet) (Z12812): rotates letters in the Latin alphabet forward by a defined number of places
- ROT1 (Latin alphabet) (Z10846): move by one letter in the English alphabet
- ROT13 (Latin alphabet) (Z10627): encode or decode a Latin alphabet string using the ROT13 cipher ROT13 encrypt/decrypt
- ROT25 (Latin alphabet) (Z10851): move each letter one letter back in the English alphabet
Cryptographic hash functions
(would be better with types representing a stream of bytes)
- SHA-1 (Z10148): SHA-1 hash of the UTF-8 representation of a string, as a lowercase hexadecimal byte string SHA-1
- SHA-256 (Z10124): returns the hexadecimal hash of a string in SHA-256 SHA-256
- SHA-384 (Z10132): returns the hexadecimal hash of a string in SHA-384 SHA-384
- SHA-512 (Z10067): hash a string using the SHA-512 function SHA-512
Experimental String operations
TODO: Explain why these exist and when people might use them.
- (!) get lemma string from Lexeme JSON (Z10037): (!) approximates mw.wikibase.lexeme.entity.lexeme:getLemma(languageCode)
- Turkish final-obstruent devoicing for string (Z10022): トルコ語の文字列において、末尾の有声阻害音を無声化した綴りを返す
- Base64 decode (Z10062): decode a string from base64 (needed to demonstrate base64 encode/decode examples)
- debug (Z12941): prints the non-empty string passed to it as a debug and returns true, if empty returns false
Natural language String operations
See context in m:Abstract Wikipedia/Updates/2023-09-08.
Bangla
- bangla grapheme split (Z10587)
- genitive case of Bangla word (Z10591)
- Sadhu → Cholito: convert classical to standard Bengali (Z11077)
- is Bangla word (Z12678)
- Is or has Bengali character (Z12892)
- Is Bangla Vowel or Consonant (Z12919)
- Gregorian to Bangla (Z12926)
- Bangla conjunct vowel separation (Z13151)
- Bangla matra (diacritic) type (Z13156)
- Bangla consonant type (articulation point) (Z13195)
- Bangla consonant type (pronunciation) (Z13238)
- Bangla vowels type (Z13270)
Brahui
- Brahui (Perso-Arabic) nominative case plural (Z12082)
- Brahui (Perso-Arabic) genitive case plural (Z12141)
- Brahui (Perso-Arabic) object case plural (Z12144)
- Brahui (Perso-Arabic) ablative case plural (Z12147)
- Brahui (Perso-Arabic) instrumental case plural (Z12149)
- Brahui (Perso-Arabic) comitative case plural (Z12151)
- Brahui (Perso-Arabic) inessive case plural (Z12153)
- Brahui (Perso-Arabic) allative case plural (Z12155)
- Brahui (Perso-Arabic) benefactive case plural (Z12157)
- Brahui (Perso-Arabic) adessive case plural (Z12159)
- Brahui (Perso-Arabic) terminative case plural (Z12161)
Breton
General
- does with word mutate in Breton? (Z11595): check whether or not a breton word is subject of initial consonant mutation
- Breton soft mutation (Z11619): renvoie la forme adoucie d'un mot en breton
- Breton hard mutation (Z11627): renvoie la forme durcie d'un mot en breton
- Breton aspirant mutation (Z11632): returns the aspirant form of a word in Breton
For Breton nouns
- Breton definite article (Z11700): returns a breton word with the definite article
- Numbers :
- is Breton plural (Z11557): check if a word is a plural in Breton
- Breton singulative (Z11616): return the singulative form of a noun in Breton
- Plural of a singulative
- Breton plural in -où (Z11611): most common ending for Breton plural, mostly for inanimate things
- Breton plural in -ioù (Z11770): terminaison du pluriel en breton, surtout pour des choses inanimées
- Breton plural in -ed (Z11775): terminaison du pluriel en breton, surtout pour des choses animées
- Breton plural -ien (Z11779): terminaison du pluriel en breton, pour des noms d'agents masculins
For Breton verbs
- is Breton verb (Z12268): verify that a word may be a verb in Breton
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.
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% |
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
- Dutch plural (Z12627): Return the plural of a Dutch noun.
English
- English plural (Z11089): Return the plural of an English word. See https://meta.wikimedia.org/wiki/Abstract_Wikipedia/Updates/2023-09-08 for context.
- English count plurality (Z11218): takes a natural number and the plural and singular cases of a count noun and returns the correct plurality
- English possessive (Z11302): makes a noun or pronoun (either subjective or objective) possessive, but use a different function for possessive determiners. see https://en.wikipedia.org/wiki/English_possessive
- English verb to agent noun (Z11390): morpheme which takes a verb and returns the agent that does that verb
- English adjective to adverb (Z11646): no description
- English comparative adjective (Z11795): morpheme which takes an adjective and returns the comparative adjective
- English regular superlative form (Z12203): regular superlative form of an English adjective or flat adverb
- English -ing form (Z13087): create the gerund / present participle form of an English verb
- English -ion base form (Z13280): The transformation of a verb into an agent noun by adding the suffix "-ion"
- English -ed form (regular) (Z13177): Create the past participle of an English verb
- English -ed form (Z13284): past tense and past participle form of the verb
- English -er form (Z13262): English verb to agent noun ending in -er
- suffix English word (Z13254): add any suffix to an English word with regular changes to spelling
- English cardinal, python (Z13588): uses American names for very large numbers
- English month name from month number (Z13596): transforms a natural number (1-12) to the name of the month
Esperanto
- is Esperanto adjective (Z10450): checks if word is an Esperanto adjective
- is Esperanto adverb (Z10491): checks if word is an Esperanto adverb
- is Esperanto noun (Z10514): checks if word is an Esperanto noun
- to h-system (Z10458): transliterates Esperanto's circumflex letters to Latin alphabet
- to x-system (Z10459): transliterates Esperanto's circumflex letters to Latin alphabet
- from x-system (Z10574): transliterates Esperanto's x-system to the proper Esperanto alphabet
- from h-system (Z10953): transliterates Esperanto's h-system to the proper Esperanto alphabet
- Esperanto plural (Z10482): writes this word in the plural form for Esperanto
- Esperanto accusative (Z12630): write accusative form of Esperanto word
- Esperanto accusative plural (Z12895): write accusative form of Esperanto word and make it plural
Finnish
- Finnish nominative plural (Z11205): Input Finnish nominative singular. Output Finnish nominative plural.
French
- French regular plural (Z11548): returns the regular plural of a noun in French
- French adjective to adverb (Z11589): Canja kalmar da akayi amfani da ita ta harshen Faransanci daga "Siffa" zuwa "Bayanau"
- French masculine adjective to feminine (Z11590): renvoie la forme féminin d'un adjectif au masculin (en orthographe traditionnelle pre-1990)
- Does this French verb belong to 1st group? (Z12436): no description
- Does this French verb belong to 2nd group? (Z12439): no description
- Does this French verb belong to 3rd group? (Z12440): no description
German
(These generally correspond to more than one form.)
- German noun, -(e)n/-innen declension (Z11722): generate the -(e)n or -innen declined form of German nouns (f. plurals)
- German noun, -s declension (Z11729): generate the -s declined form of German nouns (some f. plurals and m./n. genitives and plurals)
- German noun, umlaut + -e declension (Z11739): generate the umlaut + -e declined form of strong German nouns (some plurals)
- German noun, -n declension (Z11749): generate the -n declined form of German nouns (used to compose some other forms)
- German noun, umlaut + -en declension (Z11753): generate the umlaut + -en declined form of strong German nouns (dative plural)
- German noun, -um/-en declension (Z11762): generate the form replacing -um with -en of a German noun (some plurals)
- German noun, -e declension (Z11789): generate the -e declined form of German nouns (some masculine/neuter plurals)
- German noun, -(e)n declension (Z11834): generate the -(e)n declined form of German nouns (m./n. all except nom. sg.)
- German noun, -(e)s genitive declension (Z12689): generate the -(e)s genitive(s) of German nouns
- German noun, umlaut + -er declension (Z11996): generate the umlaut + -er declined form of strong German nouns (some plurals)
- German noun, umlaut + -ern declension (Z12004): generate the umlaut + -ern declined form of strong German nouns (some dative plurals)
Hindustani
Verb
- Urdu oblique gerund / masculine plural (Z12240)
- Urdu conjunctive adverbial (Z12242)
- Urdu absolute construction (Z12244)
- Urdu feminine singular potential participle (Z12246)
Igbo
- Suffix a verb to get it imperative form (Igbo) (Z11353): Suffixing a verb to get it imperative verb as long as the verb ends with any vowel letter. E.g imperative form of 'ga' is 'gaa'
- is an Igbo vowel (Z11306): Return true if the character is an Igbo vowel .
- Adds a preposition 'na' to a word (Igbo) (Z11248): Add na before the word when the word begins with a consonant and adds n' before the word when the word begins with a vowel.
- is an Igbo pseudo-vowel(myiriụdaume) (Z12408): Return true if the word contains an Igbo pseudo -vowel and correctly spelled otherwise return false
- Suffix a verb to get it simple past tense (Igbo) (Z12770): Suffixing a simple verb root (e.g 'ri', 'si', 'ri', me etc) to get it past tense.
- prefix a verb to get it simple present continuous tense(Igbo) (Z12806): Prefixing a simple verb root (e.g 'ri', 'si', 'ri', me etc) to get it present tense.
- get list of possible simple verb root (igbo) (Z13145): A simple verb root is a verb that has no prefix, suffix, mood and has one consonant. When given an igbo vowel it returns all the possible verb root in igbo izugbe
- is light vowel (ụdamfe) (Z13916): When given a character or word it check if it contain a light vowel/ụdamfe and return true otherwise false.
- Is heavy vowel (udaarọ) (Z13922): When given a character or word it check if it contain a heavy vowel/ụdaarọ and return true otherwise false.
- Igbo infinitive form of verb (Z13927): get the infinitive form of a verb as long as the verb follows the vowel harmony rule or if the verb is a root verb
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
- plural
- animate plural
- Persian animate plural
- Tajik animate plural
Korean
Hangul
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
- Dhanni forms without -v-
- conjunctive participle
- absolute construction
- potential participle
- imperfect participle
- Pothohari forms in -n-
- perfect participle
- subjunctive
- imperative
- gerund
- 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.
- Rohingya Hanifi noun ergative case (Z11938)
- Rohingya Fonna noun ergative case (Z12186)
- Rohingya Hanifi noun genitive case (Z12116)
- Rohingya Hanifi noun object case (Z12128)
- Rohingya Hanifi noun ablative case (Z12132)
- Rohingya Hanifi noun locative case (Z12130)
- Rohingya Hanifi noun benefactive case (Z12134)
Serbian
Sindhi
Noun
- Sindhi (Perso-Arabic) masculine u > a (Z12163)
- Sindhi (Devanagari) masculine u > a (Z12166)
- Sindhi (Perso-Arabic) masculine u > ā~ (Z12168)
- Sindhi (Devanagari) masculine u > ā~ (Z12170)
- Sindhi (Perso-Arabic) masculine u > ani (Z12172)
- Sindhi (Devanagari) masculine u > ani (Z12174)
- Sindhi (Perso-Arabic) feminine u > uni (Z12180)
- Sindhi (Devanagari) feminine u > uni (Z12183)
Turkish
Wikitext string operations
- 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
- is a chemical element symbol (Z11854): tests whether a string is a standard (currently correct) chemical element symbol
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
List operations
Basic list/iterable functions
- length of a list (Z12681): number of objects on a list
- prepend element to list (Z810): adds the supplied element to the start of the supplied list
- append element to list (Z12961): adds the supplied element to the end of the supplied list
- first element (Z811): returns the first element of the input list (labelled “Item 1”)
- last element (Z12964): the final element of a list
- list without first element (Z812): returns a list without the first element
- list without last element (Z12967): returns a list without the last element
- Is empty list (Z813): returns true if and only if the list has zero elements
- List equality (Z889): tests if two lists are exactly equal
- Map Function (Z873): return a list of elements processed by a given function
- Filter Function (Z872): return elements meeting criteria given by a function
- reverse list (Z12668): reverse the order of elements in an ordered list
- contains (Z12696): check whether a list contains a certain element
- are all true (Z12684): returns true if every list item is true
- all meet criteria (Z12735): every item on the list, when evaluated by the criteria function, evaluates to true
- is any true (Z12698): checks whether in a list of Boolean any is true
- any meet criteria (Z12738): return true if one the items of a list meets criteria given by a function, otherwise false
- is single element list (Z12755): returns true if the list has exactly one element
- is two element list (Z12759): returns true if and only if the list has exactly two elements
- is longer list (Z12851): true if first list is longer than the second, false when equal or shorter
- lists have equal length (Z12864): true if the lists have an equal number of elements, false otherwise
- lists have unequal length (Z13310): Returns true if lists have different length
- get the last n elements of a list (Z13362): return a list of the last n elements of a supplied list .
- get the first n elements of a list (Z13366): return a list of the first n elements of a supplied list
- remove first N elements of list (Z13369): returns the supplied list without the first N elements (an empty list if the number of items to be removed is greater than the length of the list or the number of items to be removed is invalid)
- remove last n elements of a list (Z13373): returns the supplied list without the last n elements. if the number of items to be remove is higher than length of the list or number of items to be remove is invalid it removes all items from list
- get the nth element of a list (Z13397): When given a valid index (1-based) return the nth element of the supplied list otherwise return nothing
- remove the nth element from a list (Z13429): When given a valid index remove the element at the position and return the supplied list otherwise return nothing
- index of first listing (1...N) (Z13708): returns the position on a list of the element tested (1...N)
Complex list/iterable functions
- is permutation (Z12741): tests if one list is a permutation of another
- concatenate lists (Z12767): appends two lists together and preserves the order of elements
- interleave lists (Z13155): interleave lists of same length together such that [ A .. Z ], [ 1 .. 26 ]...n return [ A, 1, B, 2 .. n] and if there are uneven list of same size or if this list doesnt contain lists throughout it returns an empty list
- split list into a list of two ~equal length lists (Z13224): Keeps the order of elements, first half on first list. If odd length, the first list will have just over half.
- faro out-shuffle (Z13247): a perfect riffle shuffle see https://en.wikipedia.org/wiki/Faro_shuffle
- remove first matching element from list (Z12856): returns a list equal to the original list with the first matching element removed
- remove all matching elements from list (Z13081): returns a list equal to the original list with all matching element removed
- is superset (Z12846): test whether the first list contains all elements of the second (and contains at least as many as any repeated elements)
- remove duplicates (Z13078): remove second and subsequent duplicate items without changing the order of the list
- is common element on two lists (Z13752): returns true if the two lists share at least one common element
Character operations
- next character (Z11538): returns the character one codepoint above the input character
- first letter of strings: codepoints in ascending order (Z11523): First has a <= codepoint than the second. Only considers the first character of strings.
- in codepoint order (three characters) (Z11528): characters in codepoint order (each equal or ascending)
- chr of codepoint (Z11534): the chr() function in python
- unicode of first character (Z11515): Python ord() function. Return the natural number that represents the (single/first) character input.
Natural number operations
Numeric Characteristics
Comparisons
- greater than (natural numbers) (Z13676): returns true if and only if the first number is strictly greater than the second
- greater than or equal (natural numbers) (Z13682): returns true if and only if the first number is greater than or equal to the second
- less than (natural numbers) (Z13689): returns true if the first is strictly less than the second
- less than or equal (natural numbers) (Z13695): returns true if and only if the first number is less than or equal to the second number
- are coprime (natural numbers) (Z13701): the only common factor of the two arguments is 1
- is divisible (Z13740): true if the dividend (first number) is divisible by the divisor (second number) with no remainder
- natural number is even (Z13555): true if the input is evenly divisible by 2
Selections
- greater of two natural numbers (Z13630): returns the greater of the two arguments
- lesser of two natural numbers (Z13633): returns the lower of two natural numbers
Arithmetic Functions
- Ones complement binary addition (Z12971): Performs binary addition using the ones complement method.
- Ones complement binary subtraction (Z12975): Performs binary subtraction using the ones complement method.
- add two Natural numbers (Z13521): adds two Natural numbers together, returning a Natural number
- increment by one (Z13578): increase a natural number by one
- multiply two natural numbers (Z13539): calculate the product of two natural numbers
- divide natural numbers (Z13546): returns the integral portion of the result from dividing two natural numbers
- remainder of natural number division (Z13551): remainder from dividing two natural numbers
- absolute difference between natural numbers (Z13576): magnitude of the difference, independent of the order of arguments
- subtract natural numbers with floor of 0 (Z13569): subtracts the second natural number from the first, returns 0 if the second is larger
- decrement natural number by one (Z13582): reduces the value of a natural number by one, with a floor of 0
- greatest common divisor (Z13612): returns the greatest common divisor of two natural numbers
- least common multiple (Z13660): no description
- exponentiation of natural numbers (Z13647): raise base to a power
- factorial (Z13667): returns the factorial of a natural number
- modular exponentiation (Z13818): returns the power of one natural number to another natural number, reduced mod a third natural number
- modular multiplicative inverse (Z13822): no description
- binomial coefficient (Z13848): no description
- k-permutation (Z13854): no description
Integer sequence and unary integer functions
- is Armstrong number (Z12636): Sum of individual digit to the power total number of digits is equal to original number.
- Collatz conjecture function (Z13561): returns the next entry in the Collatz sequence whose first entry is the input
- total stopping time (Collatz function) (Z14058): number of iterations of the Collatz function before the input reaches 1
Bitwise Functions
- bitwise and (Z13651): no description
- bitwise or (Z13652): disjunkce aplikovaná na jednotlivé bity
- bitwise xor (Z13653): no description
- left shift (Z13812): no description
- right shift (Z13813): no description
Number conversions
- Arabic to Roman numeral (Z11022): Convert a natural number [1, 4999] to roman numeral
- Roman to Arabic numeral (Z11023): Convert a Roman numeral to Arabic numeral
- to glagolitic numeral (Z14018): Turns a number into its representation as a glagolitic numeral. Works for the range 1-5999.
- Binary to decimal (Z12982): Takes a binary number set and returns the equivalent decimal number.
- Binary to hexadecimal (Z12987): Takes a binary number set and returns the equivalent Hexadecimal number.
- natural number to binary string (without prefix) (Z13779): no description
- int to octal (without prefix) (Z13780): Converts a decimal (base 10) integer to octal (base 8) (given as a string) without the "0o" prefix
- int to hexadecimal (lowercase, without prefix) (Z13781): no description
- int to binary (with prefix) (Z13782): no description
- int to octal (with prefix) (Z13783): Converts a decimal (base-10) integer to octal (base-8) as a string, prefixed with "0o"
- int to hexadecimal (lowercase, with prefix) (Z13784): no description
- binary to int (Z13797): no description
- octal to int (Z13798): Converts an integer from octal (base 8) (given as a string) to decimal (base 10)
- hexadecimal to natural number (Z13799): no description
- base n to int (Z13806): Converts an integer (given as a string, with base n <= 36) in the given base to decimal (base 10)
Number operations requiring future types
Types such as floating point or negative integers would benefit these functions.
Numeric Characteristics
- (!) number is between (Z10603): Returns true if a number is between a minimum and a maximum (inclusive of the endpoints)
- (!) numeric string is even (Z12480): Returns true if a number is even and false otherwise. See Z13555 for the natural number version.
- (!) numeric integer string is odd (Z12429): Returns true if a number is odd and false otherwise
Arithmetic Functions
- (!) absolute value (numeric string) (Z11235): Returns the absolute value of a number. Keep using string types until floating point numbers are available.
- (!) division of numeric strings (Z12522): see Z13546 for natural number division
- (!) modulo - string types (Z12476): returns the remainder from division, see Z13551 for natural number type
- (!) multiply two numeric strings (Z10862): Multiplies two numbers together into a product, see Z13539 for natural number type
- (!) sum list of numeric strings (Z12720): sum of an arbitrarily sized list of numbers
Trigonometric Functions
- (!) inverse cosine (Z12497): Returns the arccosine of a number
- (!) inverse hyperbolic cosine (Z12500): Returns the inverse hyperbolic cosine of a number
- (!) inverse sine (Z12505): Returns the arcsine of a number
- (!) inverse hyperbolic sine (Z12509): Returns the inverse hyperbolic sine of a number
- (!) cosine (Z12473): Returns the cosine of a angle in radians
Health Functions
- (!) Body Mass Index (metric) (Z12526): Calculate a BMI given a mass in kilograms and height in meters
- (!) Body Mass Index (imperial) (Z12572): Calculate a BMI given a mass in pounds and height in inches
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.
- (!) xorshift (Z13148): xorshift rng algorithm adapted from [[en:Xorshift#Example Implementation]]
Date operations
- is leap year (Gregorian calendar) (Z10996): Returns True if the specified year in the Gregorian calendar (the one currently used in most parts of the world) has 366 days (February 29th added), and False if the year has 365 days
- is leap year (Julian calendar) (Z11015): Returns True if the specified year in the Julian calendar has 366 days, and False if the year has 365 days
- is leap year (Jalali calendar) (Z11011): Returns True if the specified year in the Jalali calendar (one of the calendars still in use in Iran and Afghanistan, also called Persian calendar) has 366 days, and False if the year has 365 days
- is leap year (Nanakshahi calendar) (Z12176): returns true if the given year is a leap year in the Nanakshahi Punjabi calendar, and false otherwise
- Gregorian to Bangla (Z12926): Returns the Bangla equivalent date of a Gregorian date format. The input fields represent the Year, month, and day, respectively.
- get English weekday from date (Z13163): returns the weekday as a string when given a date as year, month and day of the month
- advance n days to get a later date (D/M/YYYY) (Z13306): when given date and number of day(s) to advance, it advances on top of the date been given to get a later date.
- gregorian to nengō (Z13300): converts a given gregorian year to japanese year format, in case of pivotal year, returns both results
- nengō to gregorian (Z13335): converts a given japanese year into gregorian year
Functional operations
Note that functions as argument or return types are not fully supported yet. See [1]
- apply (Z13036): a function that applies another (single argument) function to a value
- apply two-argument function (Z13318): a function that applies another (two-argument) function to two arguments
- apply a two-parameter function to a common first argument and a list of second arguments (Z13436): returns a list of results
- apply a two-parameter function to a list of first arguments and a common second argument (Z13464): returns a list of results
- string is fixpoint of function (Z12875): check if a string function evaluated at a value has the same value
Type conversion
- boolean to string (Z10730): Converts a boolean to a lowercase string for string comparison.
- natural number to digit string (Z13713): return the same natural number but in string type (unformatted, decimal)
See also
- There is an automatic, un-guided list of functions on the Special page for all objects of type Function (Z8)
- External function lists: