mirror of
https://git.pumpin.online/funkpower/catena.git
synced 2026-11-24 19:32:56 +00:00
vocabmerge: keep the best-written author heading, not the commonest
An author group is one person under several spellings, and in a catalogue built from downloads the commonest spelling is often the worst: "G.W.F. Hegel" on five books against "G. W. F. Hegel" on three, "Saint Thomas (aquinas)", "S.J. Frederick Copleston", "Fyodor. Dostoyevsky". Keeping it spreads it over every book in the group. Author headings are now ranked by form first and by count only after: a heading turned round (unless a suffix follows the comma), with a bracket, a dangling separator, a suffix in front, or in capitals loses to one without, however few books carry it; then stray full stops and run-together initials. Respellings that are all well formed still go to the commonest, so "Dostoëvsky" still merges into "Dostoevsky". Publishers and subjects are ranked as before.
This commit is contained in:
2 files changed
+75
-20
No files matched your search
@@ -282,7 +282,7 @@ fn ends_in_initial(text: &str) -> bool {
|
||||
.is_some_and(|last| last.trim_end_matches('.').chars().count() == 1)
|
||||
}
|
||||
|
||||
fn is_suffix(text: &str) -> bool {
|
||||
pub(crate) fn is_suffix(text: &str) -> bool {
|
||||
// "Md/phd": degrees run together.
|
||||
text.split('/').all(|part| {
|
||||
SUFFIXES.contains(
|
||||
|
||||
Reference in new issue
Block a user