Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 04-30-2022, 11:07 PM   #1
nami
Junior Member
nami began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jun 2019
Device: none
How to add tweak for author_use_surname_suffixes

Hi,
It's a few days I'm using Calibre and going to sort authors of 2000+ books.
In Persian it's common that surnames have a suffix. for example: pur, abadi, nezhad, etc.

Code:
first, last
ali, zamani pur
kamran, sharafi pur
hasan, kamal abadi
fatemeh, ebrahim abadi
arash, karim nezhad
I would like to do less manual tweaks for fixing authorsort and instead use a tweak to automatically treat all common suffixes as suffixes for surnames just like the one we have for prefixes.
nami is offline   Reply With Quote
Old 05-01-2022, 01:07 AM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,912
Karma: 55267620
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Preferences: Tweaks:
You want
ID: author_sort_copy_method
theducks is offline   Reply With Quote
Advert
Old 05-01-2022, 07:02 PM   #3
nami
Junior Member
nami began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jun 2019
Device: none
Quote:
Originally Posted by theducks View Post
Preferences: Tweaks:
You want
ID: author_sort_copy_method
With that I have a 'copy' option which don't have benefit of 'comma' mode like sorting authors with surnames in Authors browser (in left panel).

Are these tweaks available to end-users in a folder or the like to manipulate?
nami is offline   Reply With Quote
Old 05-01-2022, 07:16 PM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,912
Karma: 55267620
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by nami View Post
With that I have a 'copy' option which don't have benefit of 'comma' mode like sorting authors with surnames in Authors browser (in left panel).

Are these tweaks available to end-users in a folder or the like to manipulate?
Look further down on that. there are suffixes there also
theducks is offline   Reply With Quote
Old 05-01-2022, 11:39 PM   #5
nami
Junior Member
nami began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jun 2019
Device: none
Quote:
Originally Posted by theducks View Post
Look further down on that. there are suffixes there also
'author_name_suffixes' is a little near to what I mean, but yet doesn't result in a perfect sort on authors since it ignores suffixes in surnames.

Simply, I want to implement 'author_use_surname_prefixes' but for suffixes.
nami is offline   Reply With Quote
Advert
Old 05-02-2022, 03:56 AM   #6
un_pogaz
Chalut o/
un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.
 
un_pogaz's Avatar
 
Posts: 411
Karma: 145324
Join Date: Dec 2017
Device: Kobo
I don't think that the implementation of a author_use_surname_suffixes is relevant.
The way Caliber works to sort the names makes that, Yes it is necessary to pay attention to the prefixes and to manage them, but the management of suffix is superfluous (since they will all be grouped in the same place).

Develops a case where sorting a <first name> must be perfectly identical to <first name>+<suffix>?

Last edited by un_pogaz; 05-02-2022 at 04:02 AM.
un_pogaz is offline   Reply With Quote
Old 05-02-2022, 01:29 PM   #7
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 36,277
Karma: 145735552
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by un_pogaz View Post
I don't think that the implementation of a author_use_surname_suffixes is relevant.
The way Caliber works to sort the names makes that, Yes it is necessary to pay attention to the prefixes and to manage them, but the management of suffix is superfluous (since they will all be grouped in the same place).
There is no need to implement the author surname suffixes functionality since the tweak mentioned by theducks already has that functionality. Editing the list of author_name_suffixes to use the suffixes to include the list of suffixes in Persian should take care of the issue going forward.

Quote:
# Author sort name algorithm

author_sort_copy_method = 'comma'

author_name_suffixes = ('Jr',
'Sr',
'Inc',
'Ph.D',
'Phd',
'MD',
'M.D',
'I',
'II',
'III',
'IV',
'Junior',
'Senior')

author_name_prefixes = ('Mr', 'Mrs', 'Ms', 'Dr', 'Prof')

author_name_copywords = ('Agency',
'Corporation',
'Company',
'Co.',
'Council',
'Committee',
'Inc.',
'Institute',
'National',
'Society',
'Club',
'Team')

author_use_surname_prefixes = False

author_surname_prefixes = ('da', 'de', 'di', 'la', 'le', 'van', 'von')
DNSB is offline   Reply With Quote
Old 05-02-2022, 06:48 PM   #8
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,644
Karma: 26960534
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by DNSB View Post
There is no need to implement the author surname suffixes functionality since the tweak mentioned by theducks already has that functionality. Editing the list of author_name_suffixes to use the suffixes to include the list of suffixes in Persian should take care of the issue going forward.
Problem: people with genuine surname suffixes, such as Abadi, Nezhad etc, also acquire courtesy tags such as Esq, PhD etc

See "The Structure of Persian Names" ==>> https://citeseerx.ist.psu.edu/viewdo...=rep1&type=pdf

Last edited by BetterRed; 05-03-2022 at 12:02 AM.
BetterRed is offline   Reply With Quote
Old 05-03-2022, 11:01 AM   #9
un_pogaz
Chalut o/
un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.
 
un_pogaz's Avatar
 
Posts: 411
Karma: 145324
Join Date: Dec 2017
Device: Kobo
Quote:
Originally Posted by DNSB View Post
There is no need to implement the author surname suffixes functionality since the tweak mentioned by theducks already has that functionality. Editing the list of author_name_suffixes to use the suffixes to include the list of suffixes in Persian should take care of the issue going forward.
The author_name_suffixes it's for the last name suffix, the case presented by nami are suffixes to the first name.
un_pogaz is offline   Reply With Quote
Old 05-03-2022, 02:02 PM   #10
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 36,277
Karma: 145735552
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by nami View Post
Hi,
It's a few days I'm using Calibre and going to sort authors of 2000+ books.
In Persian it's common that surnames have a suffix. for example: pur, abadi, nezhad, etc.
Quote:
Originally Posted by un_pogaz View Post
The author_name_suffixes it's for the last name suffix, the case presented by nami are suffixes to the first name.
Perhaps a language issue since @nami specified surname which is, AFAIK, synonymous with last name or family name.
DNSB is offline   Reply With Quote
Old 05-04-2022, 02:52 PM   #11
nami
Junior Member
nami began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jun 2019
Device: none
Thanks all for your attention.

Quote:
Originally Posted by BetterRed View Post
Problem: people with genuine surname suffixes, such as Abadi, Nezhad etc, also acquire courtesy tags such as Esq, PhD etc

See "The Structure of Persian Names" ==>> https://citeseerx.ist.psu.edu/viewdo...=rep1&type=pdf
Yes, you are right.

I think a more detailed example will help.

This is my list of authors (see attachment to copy):




Many names are as simple as last one "Elmira Abootorabi": a one-word firstname and a one-word lastname, but there are some names with compound parts and because in many compound lastnames that consist of two parts, the second part is the same, I want to Calibre treat the first and second part of lastname as a whole lastname.

And this is my current calibre tweak:

Spoiler:
Code:
# Author sort name algorithm

author_sort_copy_method = 'comma'

author_name_suffixes = ('Jr',
 'Sr',
 'Inc',
 'Ph.D',
 'Phd',
 'MD',
 'M.D',
 'I',
 'II',
 'III',
 'IV',
 'Junior',
 'Senior')

author_name_prefixes = ['Mr',
 'Mrs',
 'Ms',
 'Dr',
 'Prof',
 'آقای',
 'خانم',
 'دکتر',
 'مهندس',
 'پروفسور',
 'پرفسور',
 'جناب آقای',
 'جناب خانم',
 'سرکار خانم']

author_name_copywords = ['Agency',
 'Corporation',
 'Company',
 'Co.',
 'Council',
 'Committee',
 'Inc.',
 'Institute',
 'National',
 'Society',
 'Club',
 'Team',
 'سازمان',
 'موسسه',
 'مؤسسه',
 'شرکت',
 'نهاد',
 'گروه',
 'کمیته',
 'مرکز',
 'مدیریت',
 'نشر',
 'آموزش',
 'ترویج',
 'آثار',
 'اداره',
 'اتحادیه',
 'شرکت\u200cها',
 'کارگروه']

author_use_surname_prefixes = False

author_surname_prefixes = ['da', 'de', 'di', 'la', 'le', 'van', 'von']
Attached Files
File Type: txt example list.csv.txt (463 Bytes, 40 views)
nami is offline   Reply With Quote
Old 05-04-2022, 07:10 PM   #12
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,644
Karma: 26960534
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by nami View Post
Thanks all for your attention.



Yes, you are right.

I think a more detailed example will help.

This is my list of authors (see attachment to copy):

Many names are as simple as last one "Elmira Abootorabi": a one-word firstname and a one-word lastname, but there are some names with compound parts and because in many compound lastnames that consist of two parts, the second part is the same, I want to Calibre treat the first and second part of lastname as a whole lastname.

And this is my current calibre tweak:

Spoiler:
Code:
# Author sort name algorithm

author_sort_copy_method = 'comma'

author_name_suffixes = ('Jr',
 'Sr',
 'Inc',
 'Ph.D',
 'Phd',
 'MD',
 'M.D',
 'I',
 'II',
 'III',
 'IV',
 'Junior',
 'Senior')

author_name_prefixes = ['Mr',
 'Mrs',
 'Ms',
 'Dr',
 'Prof',
 'آقای',
 'خانم',
 'دکتر',
 'مهندس',
 'پروفسور',
 'پرفسور',
 'جناب آقای',
 'جناب خانم',
 'سرکار خانم']

author_name_copywords = ['Agency',
 'Corporation',
 'Company',
 'Co.',
 'Council',
 'Committee',
 'Inc.',
 'Institute',
 'National',
 'Society',
 'Club',
 'Team',
 'سازمان',
 'موسسه',
 'مؤسسه',
 'شرکت',
 'نهاد',
 'گروه',
 'کمیته',
 'مرکز',
 'مدیریت',
 'نشر',
 'آموزش',
 'ترویج',
 'آثار',
 'اداره',
 'اتحادیه',
 'شرکت\u200cها',
 'کارگروه']

author_use_surname_prefixes = False

author_surname_prefixes = ['da', 'de', 'di', 'la', 'le', 'van', 'von']
What happens if you replace the existing suffixes with the Persian name suffixes (in Persian RTL script) e.g.:

Code:
author_name_suffixes = ('abadi'
'ara'
'chi'
'dust'
'fard'
'far'
'ian' 
'yan'
'ju'
'kiya'
'kia'
'manesh'
'mand'
'niya'
'nia'
'nejad'
'nezhad'
'nejhad'
'parast'
'pur'
'pour'
'poor'
'rad'
'tabar'
'vand'
'var'
'yar'
'zadeh'
'zad')
Or add them to the existing list as you have with prefixes.

BR
BetterRed is offline   Reply With Quote
Old 05-04-2022, 08:57 PM   #13
nami
Junior Member
nami began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jun 2019
Device: none
Yes, that's working. I should confess that when I was trying suffixes, I didn't checked sort order and by seeing that a name like "ali hasan abadi" turns into "abadi ali, hasan" in Manage authors window, I thought "abadi" in "hasan abadi" will be ignored on sort and then order of lastnames like "hasan pur", "hasan abadi" wouldn't be perfect... That's all wrong. Sorry.

Thank you all for your time
nami is offline   Reply With Quote
Reply

Tags
authorsort, suffixes, tweaks


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Style tweak? embryo KOReader 11 09-26-2020 09:02 PM
Trying to tweak calibre BluffOwl Introduce Yourself 1 03-22-2019 01:33 AM
Where did Tweak ePub go? MelBr Calibre 2 01-21-2014 01:37 PM
0.8.41 - New Category Tweak nynaevelan Calibre 4 02-25-2012 12:05 PM
Sorting Tweak atjnjk Calibre 6 08-31-2010 06:36 AM


All times are GMT -4. The time now is 06:57 AM.


MobileRead.com is a privately owned, operated and funded community.