my %rows;
if (my $lang = shift @ARGV) {
my %filter = (lang => $lang);
- my $cols = "ref, array_to_string(form || alt, '/'), prio, id, cat";
+ my $cols = "ref, array_to_string(form || alt, '/'), prio + coalesce(grade, 90) / 100::float, id, cat";
%rows = $db->select(_word_ref => $cols, \%filter)->map_arrays;
say pp \%rows
=~ s/\\x\{([0-9A-F]+)\}/chr hex $1/ger;
if (this.cats[ref]) {
// delve into subcategory
put(worditem, '.parent');
- this.add(worditem, this.cats[ref]);
+ this.add(worditem, this.cats[ref].sort((a, b) => {
+ const [worda, wordb] = [this.data[a], this.data[b]];
+ return (worda[1] % 1) - (wordb[1] % 1)
+ || worda[0].localeCompare(wordb[0]);
+ }));
}
});
}