Wikifunctions:Catalogue/Natural language operations/Global language functions
Appearance
See also the Wikidata operations, particularly for Lexemes, Senses, and Forms.
Sentence and fragment generation
- subject is instance of (string) (Z26039): A sentence which expresses the relationship X is an instance of Y. In English has the form "[The] X is a/n Y": "Nairobi is a city." For X subclass of Y use Z26095.
- subject is kind of (Monolingual text) (Z26095): Makes a sentence which expresses the relationship between an instance of a subclass X and its superclass Y. In English has the form "a/n X is a Y": "A frog is an amphibian." Non-subclass use Z26039
- Classifying a class of nouns (Z26627): E.g. “Antelopes are mammals", "Squares are rectangles"
- default short description for albums (Z28797): creates a short description of the form "album (performer, year)" in the given language
- short description for album (Z28803): creates a short description for an album, e.g. "1968 album by The Beatles", in the given language
- description of class with adjective and superclass (Z29743): Creates a sentence of the form "A [class] is a [adj] [superclass].", e.g. "A sheep is a domesticated mammal."
- Sentence that something begins (Z31405): A sentence that states that something starts or begins. Could be "the beginning of x", or "x starts"
- X exists in N Ys (Z32321): Makes a sentence of the form X exists in N Ys, e.g. "Wikipedia exists in 362 languages."
- Sentence that something shown in (Z32208): A = item; B = string; e.g. "Los Angeles shown in the movies"
- quantity comparison (Z32229): Description missing
- join list of strings in given language (Z32283): Description missing
- separator space/punctuation for list items in lang (Z32276): return a separator to be used between words in a given language.
- Word separator (last) (Z32297): e.g. " and " (with space) in "A, B and C"
- Collective role sentence (Z32326): Creates sentences of the form [X]s are [Y]s of [Z].
Cross-lingual sentence creation
- indefinite noun phrase with adjective (Z22664): returns an indefinite noun phrase combining the adjective and noun in the convention of a chosen language, e.g. "a beautiful Paris" for inputs "Paris" and "beauty"
- (DO NOT USE) SPO sentence (singulars in present) (Z26955): Make a sentence such as "English is a language." Where the subject and object are singular, and the tense is present. This function does not currently work in any language.
- indef number of objects phrase (Z27137): Generate a phrase like "1 watermelon", "2 bikes", ... in the selected language
- name for table header (Z27885): Given an item, returns the name of the item in a form suitable to be inserted in a table as a header
- header from item in plural (Z28254): Finds a Lexeme for a given item and returns the plural, all in sentence case
Helpers
- Genders
- grammatical gender of lexeme is exactly (Z26676): checks if a Wikidata lexeme is a specific grammatical gender
- grammatical gender (c/n) of lexeme (Z30539): Returns enumeration with either common or neuter gender.
- grammatical gender (m/f/n) of lexeme (Z28089): Description missing
- grammatical gender (m/f) of lexeme (Z26745): Description missing
- Grammatical gender of first plural form (Z23067): Returns the grammatical gender of the first plural form
- convert (m/f) grammatical genders to (m/f/n) (Z26364): Takes a grammatical gender of a binary feminine/masculine and returns the value for the ternary feminine/masculine/neuter type.
- invert grammatical gender (m/f) (Z25754): Description missing
- grammatical genders from Wikidata lexeme (Z20616): Description missing
Numbers
Natural language
| Natural language from langcode and aliases (Z35171) | K1: String (Z6) | language to language tag (Z14329) |
|---|---|---|
| K2: <String (Z6)>[...] | — | |
| language tag to language (Z860) | K1 | — |
- language tag to language (Z860): Converts BCP 47 language tag to Z60/Natural language object
- Wikifunctions language obj from Wikidata reference (Z29958): inverse of Z29649
- same language (Z14326): returns true if two given languages are the same (defined here as having identical language tags) otherwise false (or a key value error if an argument is not a Natural language object or reference)
- is language in list (Z14321): Description missing
- language from language variant (Z24097): accepts a language with a language tag and returns the language of the language subtag (by removing all subtag(s) after the first "-" in the language tag)
- list of languages to sequence of ISO codes (Z28282): Given a list of languages, returns the sequence of ISO codes separated by ";" as a string
- Word order (SOV, SVO...) of Natural language (Z33738): Description missing
- does language use NAdj order? (Z29654): returns true if Wikidata records the language as using noun-adjective ordering, and false if it's recorded as adjective-noun
- name of language in language (Z30043): Description missing
Monolingual text and stringset
| Monolingual text from String and Natural language (Z861) | K1: Natural language (Z60) | language of monolingual text (Z14404) |
|---|---|---|
| K2: String (Z6) | string of monolingual text (Z14396) |
- monolingual text equality (Z14392): tests that both the language and the string of a monolingual text are equal
- language tag of monolingual text (Z12877): returns the language tag for a monolingual text
- string of monolingual text (Z14396): gets the raw string (without the associated language) from a monolingual text
- display Monolingual text (Z21583): Description missing
- Monolingual text as HTML with visible language tag (Z29749): escapes the given string for inclusion in HTML (rich text), and if its language code doesn't match the given language, prepends that code (as plaintext, but may be rich text in future, see T340624)
- first monolingual text from multilingual text (Z19254): returns the first monolingual text entry in a multilingual text
- multilingual text to list of monolingual texts (Z19279): converts a multilingual text to a list of monolingual texts
- monolingual stringsets from multilingual stringset (Z23236): returns the list of monolingual stringsets (key Z32K1) from a multilingual stringset
- monolingual text from language and string (Z26107): Description missing
- coerce text-like object to Monolingual text (Z34663): takes either a String, a Monolingual text, or a Unicode codepoint and returns a Monolingual text
Multilingual text and stringset
- same multilingual text (Z19312): Description missing
- first monolingual text from multilingual text (Z19254): returns the first monolingual text entry in a multilingual text
- languages of multilingual text (Z19272): returns a list of the natural languages which have a monolingual text as part of a multilingual text
- multilingual text to list of monolingual texts (Z19279): converts a multilingual text to a list of monolingual texts
- monolingual stringsets from multilingual stringset (Z23236): returns the list of monolingual stringsets (key Z32K1) from a multilingual stringset
- choose the language and replace the parameters (Z27893): Description missing
Select a language and language configurator
- select a function based on language (Z14310): returns a function associated with the requested language on a configuration list. This is used in general functions which need to work differently in different languages.
- select a function based on lists of languages (Z14311): Description missing
- number of function options in configuration (Z14548): Description missing
- first monolingual text from list with language (Z23156): returns the first monolingual text with the specified language from a list of monolingual texts
- string of first listed monolingual text with lang (Z23159): Description missing
- filter list of monolingual texts by language (Z23143): Description missing