hushidong / biblatex-gb7714-2015

A biblatex implementation of the GB/T7714-2015 bibliography style || GB/T 7714-2015 参考文献著录和标注的biblatex样式包
763 stars 84 forks source link

利用key排序无法融合姓名有无逗号。 #160

Closed earthmoon closed 1 year ago

earthmoon commented 1 year ago

假如现在有两篇文献:

@article{曾卡卡,
    type = {10.13s866/j.azr.2021.05.s08},
    title = {来源分析},
    author = {曾卡卡},
    date = {2011},
    journaltitle = {研究},
    volume = {328},
    number = {025},
    pages = {12263--12273},
    doi = {10.132866/j.azr.20212.05.08},
    abstract = {第一篇摘要},
    isbn = {10s01-46s75},
    langid = {chinese},
    keywords = {guanjianci1,guanjianci2},
    key = {zeng1ka2ka2},
}

@article{曾详细2020,
    title = {名字},
    author = {曾详细},
    date = {2028},
    journaltitle = {我们},
    volume = {450},
    number = {126},
    pages = {56211--56129},
    issn = {10020-09233},
    doi = {10.58426/stxb201910302222294},
    abstract = {这是摘要.},
    langid = {chinese},
    keywords = {关键词10},
    key = {zeng1xiang2xi4},
}

这时候用biber编译,是正确的。

如果内容为:

@article{曾卡卡,
    type = {10.13s866/j.azr.2021.05.s08},
    title = {来源分析},
    author = {曾卡卡},
    date = {2011},
    journaltitle = {研究},
    volume = {328},
    number = {025},
    pages = {12263--12273},
    doi = {10.132866/j.azr.20212.05.08},
    abstract = {第一篇摘要},
    isbn = {10s01-46s75},
    langid = {chinese},
    keywords = {guanjianci1,guanjianci2},
    key = {zeng1ka2ka2},
}

@article{曾详细2020,
    title = {名字},
    author = {曾详细},
    date = {2028},
    journaltitle = {我们},
    volume = {450},
    number = {126},
    pages = {56211--56129},
    issn = {10020-09233},
    doi = {10.58426/stxb201910302222294},
    abstract = {这是摘要.},
    langid = {chinese},
    keywords = {关键词10},
    key = {zeng1, xiang2xi4},
}

即把key = {zeng1xiang2xi4}改为key = {zeng1, xiang2xi4},会发现排序出现了问题。这一问题有办法解决吗?谢谢!

hushidong commented 1 year ago

不要加key好了,用另一种方法。

不加key,直接替换pinyin.pm。我把这个pinyin.pm改了,可以适用于曾,沈的的姓的拼音的排序。

参考:https://github.com/hushidong/biblatex-gb7714-2015/issues/157

earthmoon commented 1 year ago

不要加key好了,用另一种方法。

参考:#157

若您有时间,我想您把他修复吧。借助bibmap配合biblatex也有它的用途,让它们更完美更好。

hushidong commented 1 year ago

你现在的zeng1, xiang2xi4是根据曾, 详细得到的吧?只要采用统一的key生成方式就可以正常排序了,这需要bibmap里面先做一个处理就好了。比如先将曾, 详细转成统一的中文名形式,比如:曾详细就好了。

这个不复杂,在addpinyin.py里面做一个提前的处理就好了,后面我更新一下。

earthmoon commented 1 year ago

你现在的zeng1, xiang2xi4是根据曾, 详细得到的吧?只要采用统一的key生成方式就可以正常排序了,这需要bibmap里面先做一个处理就好了。比如先将曾, 详细转成统一的中文名形式,比如:曾详细就好了。

这个不复杂,在addpinyin.py里面做一个提前的处理就好了,后面我更新一下。

谢谢!这个只针对中文处理好一点,英文不需要处理。目前bibmap程序对英文也会处理,这样似乎有点多余,而且会造成其他意想不到的结果。比如某些英文文献并没有author域,通过bibmap生成key 会造成没有author域的作者排序错误。

还有另外一个问题:当中文作者,比如曾详细,如果区分姓、名,author域为author = {曾,详细},这时候通过bibmap添加key域会输出key = {zeng1, xiang2xi4},这是对的;如果采用合并姓名的管理方式,,author域为author = {{曾详细}},这时候通过bibmap添加key会输出key = {{zeng1xiang2xi4}},这时候通过key域排序会发现顺序不对。也就是key域最好可以去除逗号,再去除所有的花括号,仅保留key域一行一对最外面的花括号就好。

谢谢!

hushidong commented 1 year ago

已修改,见bibmap中的bibmapaddpinyinkey.py文件。

earthmoon commented 1 year ago

中的bibmapaddpinyinkey

您这个是对的。不过 binary 文件夹里面的 bibmapaddpinyinkey.py 没有更新。建议把这里面的这个也更新一下就可以了。

谢谢!

hushidong commented 1 year ago

你没有用新的文件,覆盖一下。

获取Outlook for Androidhttps://aka.ms/AAb9ysg


From: earthmoon @.> Sent: Tuesday, April 4, 2023 7:59:32 PM To: hushidong/biblatex-gb7714-2015 @.> Cc: hzzmail @.>; Comment @.> Subject: Re: [hushidong/biblatex-gb7714-2015] 利用key排序无法融合姓名有无逗号。 (Issue #160)

中的bibmapaddpinyinkey

测试了一下,多音已经处理了。但是英文文献仍旧会增加 key 域;中文姓、名原来是分开的,key 域中仍旧也是分开的,没有删除逗号和逗号后的空格;如果原来author={{曾详细}},现在处理后为author={{zeng1xiang2xi4}},没有去掉里面多余的花括号哎。

谢谢!

― Reply to this email directly, view it on GitHubhttps://github.com/hushidong/biblatex-gb7714-2015/issues/160#issuecomment-1495849182, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AE3ZZI6VRXTCCE7QNT674GTW7QEKJANCNFSM6AAAAAAWSBSXF4. You are receiving this because you commented.Message ID: @.***>

earthmoon commented 1 year ago

我用了你的新文件去覆盖,就运行对了。为什么 binary 文件夹里面的 bibmapaddpinyinkey.py 没有与 binary 文件夹外面的 bibmapaddpinyinkey.py 一样?出于什么考虑呢?

hushidong commented 1 year ago

那个只是用来测试的,我刚才没有管那个文件夹,测试拼音的那个文件夹是,addpinpyin那个。bat运行一下,你也能看到变化。

获取Outlook for Androidhttps://aka.ms/AAb9ysg


From: earthmoon @.> Sent: Tuesday, April 4, 2023 8:18:14 PM To: hushidong/biblatex-gb7714-2015 @.> Cc: hzzmail @.>; Comment @.> Subject: Re: [hushidong/biblatex-gb7714-2015] 利用key排序无法融合姓名有无逗号。 (Issue #160)

我用了你的新文件去覆盖,就运行对了。为什么 binary 文件夹里面的 bibmapaddpinyinkey.py 没有与 binary 文件夹外面的 bibmapaddpinyinkey.py 一样?处于什么考虑呢?

― Reply to this email directly, view it on GitHubhttps://github.com/hushidong/biblatex-gb7714-2015/issues/160#issuecomment-1495873500, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AE3ZZI42MTTLFXBWU5GIO7DW7QGQNANCNFSM6AAAAAAWSBSXF4. You are receiving this because you commented.Message ID: @.***>

hushidong commented 1 year ago

实际上,bib文件修改,可以有很多玩法,可以自己写,那些.py都是例子。

获取Outlook for Androidhttps://aka.ms/AAb9ysg


From: hzzmail @.> Sent: Tuesday, April 4, 2023 8:20:57 PM To: hushidong/biblatex-gb7714-2015 @.>; hushidong/biblatex-gb7714-2015 @.> Cc: Comment @.> Subject: Re: [hushidong/biblatex-gb7714-2015] 利用key排序无法融合姓名有无逗号。 (Issue #160)

那个只是用来测试的,我刚才没有管那个文件夹,测试拼音的那个文件夹是,addpinpyin那个。bat运行一下,你也能看到变化。

获取Outlook for Androidhttps://aka.ms/AAb9ysg


From: earthmoon @.> Sent: Tuesday, April 4, 2023 8:18:14 PM To: hushidong/biblatex-gb7714-2015 @.> Cc: hzzmail @.>; Comment @.> Subject: Re: [hushidong/biblatex-gb7714-2015] 利用key排序无法融合姓名有无逗号。 (Issue #160)

我用了你的新文件去覆盖,就运行对了。为什么 binary 文件夹里面的 bibmapaddpinyinkey.py 没有与 binary 文件夹外面的 bibmapaddpinyinkey.py 一样?处于什么考虑呢?

― Reply to this email directly, view it on GitHubhttps://github.com/hushidong/biblatex-gb7714-2015/issues/160#issuecomment-1495873500, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AE3ZZI42MTTLFXBWU5GIO7DW7QGQNANCNFSM6AAAAAAWSBSXF4. You are receiving this because you commented.Message ID: @.***>

earthmoon commented 1 year ago

哦哦,明白了。只是看 https://github.com/hushidong/biblatex-map 的介绍有

binary 用于生成一个可以带走的绿色工具(整个文件夹作为工具)

所以我直接使用了这个文件夹,用了老文件。

现在懂了。谢谢!

earthmoon commented 1 year ago

您好,

我刚测试了一下新的Pinpin.pm,还有以下几个问题:

  1. 覃,默认的读法是“tan",改为”qin“是不是更好; 2.当姓名中出现逗号,则排序出现问题,能否自动处理中文姓名中的逗号的影响?比如:
    
    @article{古方划203,
    title = {题目1},
    author = {古, 方划},
    date = {2023},
    journaltitle = {大地科学},
    volume = {1w0},
    number = {ew6},
    pages = {57we2--58we0},
    issn = {21w66-6w024},
    doi = {10.12ew677/JweWRR.2021.106062},
    langid = {chinese},
    }

@article{古厉哈那题2029, type = {10.13s287/j.1001-9332.2s02207.032}, title = {题目2}, author = {古厉哈那题}, date = {2029}, journaltitle = {空间}, volume = {3s3}, number = {0s7}, pages = {1s893--19d00}, doi = {10.13d287/j.1001-9332.20sa2207.032}, isbn = {1s001-93s32}, langid = {chinese}, }


这两篇文献编译后,文末参考文献**古厉哈那题**在前,无法正确排序了
3.**吕**姓会在**罗**姓之前,**u** 和 **v** 没有区分

感觉第1、第3相对好解决,第2应该不是pm的问题了吧,可以解决不?

谢谢!
hushidong commented 1 year ago
  1. 姓两个读音的就不再改了。因为都有支持。

  2. 是没有问题的,你的再查一下。我用的texlive2023

图片

\documentclass{article}
\usepackage{ctex}

\begin{filecontents}[force]{\jobname.bib}

@article{古方划203,
    title = {题目1},
    author = {古, 方划},
    date = {2023},
    journaltitle = {大地科学},
    volume = {1w0},
    number = {ew6},
    pages = {57we2--58we0},
    issn = {21w66-6w024},
    doi = {10.12ew677/JweWRR.2021.106062},
    langid = {chinese},
}

@article{古厉哈那题2029,
    type = {10.13s287/j.1001-9332.2s02207.032},
    title = {题目2},
    author = {古厉哈那题},
    date = {2029},
    journaltitle = {空间},
    volume = {3s3},
    number = {0s7},
    pages = {1s893--19d00},
    doi = {10.13d287/j.1001-9332.20sa2207.032},
    isbn = {1s001-93s32},
    langid = {chinese},
}

@thesis{汤某某,
author    = {汤某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{吕某某,
author    = {吕某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{罗某某,
author    = {罗某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{朴某某,
author    = {朴某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{单某某,
author    = {单某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{解某某,
author    = {解某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{区某某,
author    = {区某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{查某某,
author    = {查某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{繁某某,
author    = {繁某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{瞿某某,
author    = {瞿某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{员某某,
author    = {员某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{能某某,
author    = {能某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{阚某某,
author    = {阚某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{都某某,
author    = {都某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{乜某某,
author    = {乜某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{缪某某,
author    = {缪某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{句某某,
author    = {句某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{阿某某,
author    = {阿某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{谌某某,
author    = {谌某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{尉迟某某,
author    = {尉迟某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{澹台某某,
author    = {澹台某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{仇某某,
author    = {仇某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{曾某某,
author    = {曾某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{白某某,
author    = {白某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{戴某某,
author    = {戴某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2010},
}

@thesis{沈某某,
author    = {沈某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2011},
}

@thesis{王某某,
author    = {王某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2011},
}

@thesis{齐某某,
author    = {齐某某},
title     = {CGF建模方法与应用研究},
publisher = {科技大学},
date      = {2011},
}

\end{filecontents}

\usepackage[style=gb7714-2015ay]{biblatex} %,defernumbers=true
\addbibresource{\jobname}

\begin{document}

text\nocite{*}

\printbibliography

\end{document} 
  1. 吕的拼音好像当做ü处理的,而不是v,所以会在lu后,而在luo前。这个如果要改,可能需要更权威和准确的拼音排序说明。
earthmoon commented 1 year ago

您好,

  1. 作为姓,的确可以读tan2,是我误以为都读qin2
  2. 你的测试文件确实是对的,是我没有做好,把这个加进去就会发现不对:
    @article{谷方划2025,
    title = {测试文章名},
    author = {谷, 方划 and 张, 三},
    date = {2025},
    }

输出结果为: image

难道只判断第一个字,然后按笔划来了?

3.的拼音应该按照ü处理,是我误以为Lv,所以吕罗排序没问题,这个有文献支撑:

梁洁.学术期刊中姓氏“吕”的汉语拼音错误用法辨析[J].黄冈师范学院学报,2015,35(05):64-66.

谢谢!

earthmoon commented 1 year ago

您好,

  1. 作为姓,的确可以读tan2,是我误以为都读qin2
  2. 你的测试文件确实是对的,是我没有做好,把这个加进去就会发现不对:
@article{谷方划2025,
  title = {测试文章名},
  author = {谷, 方划 and 张, 三},
  date = {2025},
}

输出结果为: image

难道只判断第一个字,然后按笔划来了?

3.的拼音应该按照ü处理,是我误以为Lv,所以吕罗排序没问题,这个有文献支撑:

梁洁.学术期刊中姓氏“吕”的汉语拼音错误用法辨析[J].黄冈师范学院学报,2015,35(05):64-66.

谢谢!

这个第2点是有问题的,难道不修复了么?

hushidong commented 1 year ago

一个字一个字排序有排序没有问题呀?排完第一个字再排第二个字,本来就应该这样的。而不是按key那种方式,英文字符串的排序是也是一个字符一个字符排的,但其实不是正确的方式,中文环境下只是勉强用而已。你看字典,不可能古还没完就来个谷吧。

earthmoon commented 1 year ago

一个字一个字排序有排序没有问题呀?排完第一个字再排第二个字,本来就应该这样的。而不是按key那种方式,英文字符串的排序是也是一个字符一个字符排的,但其实不是正确的方式,中文环境下只是勉强用而已。你看字典,不可能古还没完就来个谷吧。

你这一说,我感觉很新颖!不过我觉得正确方式应该是按照拼音,类似于key。不过字典实现不了也没办法了。

hushidong commented 1 year ago

排序是不是按照一个一个字符来的?是的。

无论是中文还是英文都是的。

采用key的方式把一个汉字映射成多个英文字符然后再排序,使得排序的单位变小了,才有你现在理解。

正常的汉字排序,就应该是先根据第一个汉字排序,若第一个汉字相同,那么再根据第二个汉字排序,依次类推

若采用key的方式,第一个汉字的排序就可能由于同音导致排序出现问题,若第一个字是:谷,古,股,把他们作为看做相同的,然后再按照后续的字的key来排序实际上是不合理的,第一个汉字即便是同音在汉字里面也是有顺序的,不可以混淆的。 比如有:张一,张二,章三,显然中文的正常的按中文字符拼音排序应该是: 张二 张一 章三

而不能是按key排出来的: 张二 章三 张一

这种显然不太符合中文的习惯的,中文的习惯肯定也要把张排完再是章。

earthmoon commented 1 year ago

有一定道理。你说的这个

一个汉字即便是同音在汉字里面也是有顺序的

同音汉字应该怎么排序?默认的规则是什么?难道是笔划?

hushidong commented 1 year ago

暂时这么猜,具体要看pinyin.pm那个文件根据什么排的。可能有标准,只是我们不是特别了解。

hushidong commented 1 year ago

暂时这么猜,具体要看pinyin.pm那个文件根据什么排的。可能有标准,只是我们不是特别了解。

earthmoon commented 1 year ago

暂时这么猜,具体要看pinyin.pm那个文件根据什么排的。可能有标准,只是我们不是特别了解。

有道理。