Page MenuHomePhabricator

Words generator: words from Wikidata Lexemes
Open, In Progress, MediumPublicFeature

Description

In LinguaLibre RecordWizard, when we reach the screen for adding texts we want to record, the possibility to add Lexemes is covered by the "External Tools" section, where you need to add a query for the kind of lexemes you want to add. This is not obvious or easy for most of the users, much less for people from small language communities.

irudia.png (761×1 px, 53 KB)

A generator for adding automatically lexemes in the language I have chosen that lack an audio should be added there, making easy to record pronunciation of lexemes.

Event Timeline

Theklan changed the subtype of this task from "Task" to "Feature Request".
VIGNERON renamed this task from Add a button for getting Lexemes without audios to Create a generator for Lexemes on LinguaLibre RecordWizard.May 27 2021, 11:01 AM
VIGNERON updated the task description. (Show Details)

I change the task a bit. This kind of tool in called a generator (see Help:Create a new generator on lingualibre).

Generator can have multiple parameters, language is an obvious one here. Random additional ideas: for forms with or without recording, a limit (like other generator), the lexical category, a choice between the main lemma and forms. More suggestions are welcome.

Yug triaged this task as Low priority.Jul 6 2022, 10:40 AM
Yug renamed this task from Create a generator for Lexemes on LinguaLibre RecordWizard to Words generator: words from Wikidata Lexemes.Jul 7 2022, 10:05 AM
Yug raised the priority of this task from Low to Medium.

Hello @Theklan ,
It's not user friendly as of now but you can already use the more generalist Wikidata generator using SPARQL query URL. I just did it.
At Step 3 : List of words to record, use the External tools generator, paste in your Wikidata Query URL.

The requirement is for your SPARQL to return 1) the Qid / Lexeme L id under ?id, and the word string under ?label.

LEXEME SPARQL
SPARQL
# Lexemes in English that match an expression
SELECT ?id ?label WHERE {
  ?id dct:language wd:Q1860;
            wikibase:lemma ?label
  # only those lemmas that begin with "pota", i.e. "potato"
  FILTER (regex(?label, '^pota.*'))
}
ORDER BY asc(?label) # Sort alphabetically
LEXEME URL

https://query.wikidata.org/#%23Lexemes%20in%20English%20that%20match%20an%20expression%0A%23%20Lexemes%20in%20English%20that%20match%20an%20expression%0ASELECT%20%3Fid%20%3Flabel%20WHERE%20%7B%0A%20%20%3Fid%20dct%3Alanguage%20wd%3AQ1860%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20wikibase%3Alemma%20%3Flabel%0A%20%20%23%20only%20those%20lemmas%20that%20begin%20with%20%22pota%22%2C%20i.e.%20%22potato%22%0A%20%20FILTER%20%28regex%28%3Flabel%2C%20%27%5Epota.%2a%27%29%29%0A%7D

See also

  • T354636 Words Generator: Words from Wikidata items' labels (SPARQL Query)

@Saltykheera , as you requested it I assigned you this task. 👍🏼 You can duplicate and use the Step 4 > External Tool generator front-end/src/components/RecordWizard/ExternalToolsDialog.vue . It's a special subcase of it, the SPARQL query is more regular.

So you just need to ask the user for the word pattern. Then, you replace on the SPARQL above the languange and the pattern by those wanted by your user.

Step 4

Add a button for Lexemes (generator).
This will open codex modal.

Modal's Fields

  • Language Wikidata Qid : I believe the vue js data contains the working language's wikidata Qid which you will use to replace the default Q1860 from English language. So you need to grab that value but you don't need input field for that.
  • Item match pattern: you will need the modal to ask that matching pattern with an initial place holder message "Enter match pattern".
  • Run button: or alternative will apply the replacement and run the SPARQL query.

SPARQL

SPARQL
SPARQL
# Lexemes in English that match an expression
SELECT ?id ?label WHERE {
  ?id dct:language wd:Q1860;  # <----------------------------------- LANGUAGE "Q1860" TO REPLACE HERE
            wikibase:lemma ?label
  # only those lemmas that begin with "pota", i.e. "potato"  
  FILTER (regex(?label, '^pota.*')) # <----------------------------------- PATTERN "^pota.*" TO REPLACE HERE
}
ORDER BY asc(?label) # Sort alphabetically

Critical thinking

Maybe my proposal duplicates too much code. Maybe hacking and adding a IF and parameter to the External tool generator will be a better idea. Explore and discuss with Pushkar or me about that (rather me).

@Saltykheera , I found the following logos. I think you can add them into the icon folder :

As for the language label, there is a function which you can use to fetch that label :

@Saltykheera , please link to the PR or commit in this task.

Seems well underway. Letting you Kheera close this task when merge 👍🏼

Yug changed the task status from Open to In Progress.Tue, Dec 17, 10:52 AM