# 开源: 德中命令行对齐工具python包 dzbee

**URL:** <https://forum.freemdict.com/t/topic/12975>\
**Category:** 技术交流与词典编修\
**Tags:** python, deutsch, 对齐, 平行库, german, 德语\
**Created:** [2022 年5 月 14 日 02:11 UTC](https://forum.freemdict.com/t/topic/12975 "2022-05-14T02:11:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikeee](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/mikeee/32/18656_2.png) [@mikeee](https://forum.freemdict.com/u/mikeee)\
**Post date:** [2022 年5 月 14 日 02:11 UTC](https://forum.freemdict.com/t/topic/12975/1 "2022-05-14T02:11:14Z")

</div>

**仅支持 Pytho 3.8**  
[https://github.com/ffreemt/dzbee](https://github.com/ffreemt/dzbee)

**先装** `fasttext`, `pycld2`, `PyICU`， 例如 `pip install fasttext pycld2 PyICU`  
（无C++编译环境的系统装对应的 whl [Archived: Python Extension Packages for Windows - Christoph Gohlke](https://www.lfd.uci.edu/~gohlke/pythonlibs/)  
例如 `pip install fasttext-0.9.2-cp38-cp38-win_amd64.whl pycld2-0.41-cp38-cp38-win_amd64.whl PyICU-2.8.1-cp38-cp38-win_amd64.whl`）

**安装**  
`pip install dzbee`  
或  
`poetry add dzbee`

文档：`dzbee --help` 或 `python -m dzbee`

**使用** ：`dzbee file1 file2` 或 `python -m dzbee file1 file2` （预设输出格式 tsv xlsx）

结果展示（ 茨威格的 ‎人类的群星闪耀时，无视法语的干扰 😀！）

 ![DSWDOZD0BR9O30HUBVNDOK4](https://forumcdn.freemdict.com/uploads/default/original/3X/5/5/55866836b8e941c11c71490f903c9318b693ea73.jpeg)

```auto
Usage: python -m dzbee [OPTIONS] file1 [file2]...

  Align de-zh texts, fast.

  e.g.

  * dzbee file1 file2

  * dzbee file1 file2 -p # show plots

  * dzbee file1 -s

  * dzbee file1 file2 -s

Arguments:
  file1 [file2]... files (absolute or relative paths) to be aligned; if only
                    one file is specified, the -s flag must be used to signal
                    it's an german/chinese mixed text file and needs to be
                    separated. [required]

Options:
  --eps FLOAT epsilon [default: 10]
  --min-samples INTEGER eps, min-samples: Larger esp or smaller
                                min_samples will result in more aligned pairs
                                but also more false positives (pairs falsely
                                identified as candidates). On the other hand,
                                smaller esp or larger min_samples values tend
                                to miss `good` pairs. [default: 6]
  -s, --need-sep Separate input files that are mixed german
                                and chinese text.
  -p, --show-plot Show heatmap and align trace plots in the
                                default browser.
  --save-xlsx / --no-save-xlsx Save xlsx. [default: save-xlsx]
  --save-tsv / --no-save-tsv Save tsv. [default: save-tsv]
  --save-csv / --no-save-csv Save csv. [default: no-save-csv]
  -v, -V, --version Show version info and exit.
  --help Show this message and exit.

```

---

<div class="post-metadata">

**Author:** ![hua](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/hua/32/11090_2.png) [@hua](https://forum.freemdict.com/u/hua)\
**Post date:** [2022 年5 月 14 日 02:40 UTC](https://forum.freemdict.com/t/topic/12975/2 "2022-05-14T02:40:09Z")

</div>

咋不用 pycld3 哈哈哈

---

<div class="post-metadata">

**Author:** ![mikeee](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/mikeee/32/18656_2.png) [@mikeee](https://forum.freemdict.com/u/mikeee)\
**Post date:** [2022 年5 月 14 日 02:44 UTC](https://forum.freemdict.com/t/topic/12975/3 "2022-05-14T02:44:02Z")

</div>

那个 pycld2 和 pyicu 是别的包（polyglot）的依赖

---

<div class="post-metadata">

**Author:** ![hua](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/hua/32/11090_2.png) [@hua](https://forum.freemdict.com/u/hua)\
**Post date:** [2022 年5 月 14 日 02:51 UTC](https://forum.freemdict.com/t/topic/12975/4 "2022-05-14T02:51:30Z")

</div>

我知道的问题是 pycld3 在 windows上超级难安装

---

<div class="post-metadata">

**Author:** ![mikeee](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/mikeee/32/18656_2.png) [@mikeee](https://forum.freemdict.com/u/mikeee)\
**Post date:** [2022 年5 月 14 日 03:15 UTC](https://forum.freemdict.com/t/topic/12975/5 "2022-05-14T03:15:24Z")

</div>

目标就是给Linux/Mac可能，[https://www.lfd.uci.edu/~gohlke/pythonlibs/](https://www.lfd.uci.edu/~gohlke/pythonlibs/)上好像还没有 whl 给Windows用的
