l0o0 / translators_CN

Zotero translator中文网页抓取翻译器🎉This is Zotero translators for Chinese Sites(beta), not the official Zotero repo
GNU Affero General Public License v3.0
4.03k stars 523 forks source link

feat (PKULaw.js) 统一内部函数;精简代码;更新测试用例;支持多条目 #270

Closed jiaojiaodubai closed 8 months ago

jiaojiaodubai commented 8 months ago

通过引进Labels类,并且集中到scrape()处理,大大减少了代码量,同时提高了稳定性(Labels提供的GetWith()tryMatch()总是能返回合适的对象类型)。 相关讨论和条目要求见 #134 #129 。

抓取结果基本不变,变动的地方主要在统一了“libraryCatalog”字段,然后补充了某些条目原来缺失的作者和案号(不知道是不是画蛇添足)。麻烦大家帮我审阅。

zepinglee commented 8 months ago

像《刑法修正案(十)》和《公司法》不要填 session。这是因为《法学引注手册》关于“法律条文”和“法律性质的决定”有不同的格式要求(后者需要著录决定时间和会议届次),我们之前讨论的结果是根据是否有 session 进行区分。

Screenshot 2024-01-02 at 21 38 17

https://github.com/redleafnew/Chinese-STD-GB-T-7714-related-csl/blob/9e26a5352a80abdc7f7056bbee41aecfd9a94d3b/301manual-of-legal-citation-multi-lingual.csl#L759-L785

      <!-- (四)引用法律文件 -->
      <else-if type="legislation treaty" match="any">
        <group delimiter=",">
          <group>
            <text macro="title-zh"/>
            <choose>
              <!-- 优先使用 locator 的条文序号 -->
              <if variable="locator">
                <text macro="locator-zh"/>
              </if>
              <else-if variable="section">
                <text macro="section-zh"/>
              </else-if>
            </choose>
          </group>
          <choose>
            <if variable="chapter-number">
              <!-- 63.2) 引用全国人大及其常委会通过的法律性质的决定 -->
              <group>
                <text macro="issuance-zh"/>
                <text variable="chapter-number"/>
                <text value="通过"/>
              </group>
            </if>
          </choose>
        </group>
      </else-if>
jiaojiaodubai commented 8 months ago

已修正,仅更新了上面涉及的测试案例

jiaojiaodubai commented 8 months ago

暂时先合并了