Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

代码可视化 - 使用图技术为 Python 项目绘制结构图 #8071

Merged

Conversation

Ashira97
Copy link
Contributor

译文翻译完成,请各位大佬校对~ resolve #7995

@lsvih lsvih changed the title Translate/building a map of your python project 代码可视化 - 使用图技术为 Python 项目绘制结构图 Feb 22, 2021
@chzh9311
Copy link
Contributor

校对认领 @lsvih

@lsvih
Copy link
Member

lsvih commented Feb 26, 2021

@chzh9311 欢迎校对!

Copy link
Contributor

@PassionPenguin PassionPenguin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有些地方的断句..有些迷糊,但总而言之翻译得真棒~

@lsvih @Ashira97

> * 校对者:

# Building a Map of Your Python Project Using Graph Technology — Visualize Your Code
# 代码可视化 -使用图技术为 Python 项目绘制结构图

![Image by author](https://cdn-images-1.medium.com/max/4294/1*T9vp27fzwWkKNw681HIGAA.png)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

翻译一下吧~


![Image by author](https://cdn-images-1.medium.com/max/4294/1*T9vp27fzwWkKNw681HIGAA.png)

As a mathematician and working data scientist, I am fascinated by programming languages, machine learning, data, and of course, mathematics.
作为一名致力于数据科学的数学家,我对编程语言、机器学习、数据和数学都很感兴趣。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的 working data scientist 应该是和 mathematician 并列的成分吧...


He needed and discovered what is now known as a mathematical graph (or just **graph** for short).
为了解决这个问题,他发现了一种被称作数学图的工具(或者简称为**图**)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里就可以说是创立?了叭,发现就不太妥当了,毕竟图论就是他整出来的啊

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我翻译为 发明 您看怎么样

Copy link
Contributor

@chzh9311 chzh9311 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

校对完成 @Ashira97 @lsvih
大部分是细节上的改动,整体翻译的很好~

> * 校对者:

# Building a Map of Your Python Project Using Graph Technology — Visualize Your Code
# 代码可视化 -使用图技术为 Python 项目绘制结构图
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

破折号前后要加空格
另外,中文破折号是两格长,即 ——


**Okay… Why is this important?**
**好的...这一点为什么那么重要呢?**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我觉得这里还行…… 要和后面的 “因为” 接上的话也不太好改叭……


I will leave it as an exercise to the reader to build this Python mapping him/her-self because I am not allowed to open source the code for this project. However, I will give you some hints as to how to build this yourself.
我将把构建这个 Python 映射的任务留给读者作为练习,因为不打算开放这个项目的源代码。但是,我将给一些帮助您构建的提示。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

【因为不打算开放这个项目的源代码。】
=>
【因为我不方便开放这个项目的源代码。】
原文说不允许,改成这个要合适一些吧,要不然显得作者是个小心眼儿一样 XD

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哈哈哈哈哈哈好的~


We need to keep track of imports and calls to other files along with building a file crawler because you don't know how deep the repository is. Every object that we store has a source file where it was created and we need to store that as a property of the node because if two objects are called the same in two different files we need to be careful not to merge them into the same object when we create the graph.
我们需要在构建文件爬取器的时候跟踪对其他文件的引入和调用,因为我们不知道这个项目有多深。我们存储的每个对象都有一个对应的创建它的源文件,并且我们需要将对应的源文件存储为对象的一个属性,因为如果两个对象在两个不同的文件中以相同名字被调用的时候,我们不应该在结构图中将这两个对象合并到一起。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

【我们需要在构建文件爬取器的时候跟踪对其他文件的引入和调用】
=>
【我们需要在逐行解析文件的时候跟踪对其他文件的引入和调用】
crawler 应该是指前面说的一行一行解析代码的动作吧,而且突然出现有点突兀可能不好理解~

…isualize-your-code.md

按照校对意见修改
@Ashira97
Copy link
Contributor Author

Ashira97 commented Mar 2, 2021

@PassionPenguin @chzh9311 感谢两位老师校对~ 辛苦啦~
@lsvih 您好,按照校对意见修改完毕。有一处不确定的地方加了译者注,麻烦您检查还有木有问题噻~

@lsvih
Copy link
Member

lsvih commented Mar 2, 2021

LGTM

@lsvih lsvih merged commit a05ff66 into xitu:master Mar 2, 2021
@lsvih
Copy link
Member

lsvih commented Mar 2, 2021

@Ashira97 已经 merge 啦~ 快快麻溜发布到掘金然后给我发下链接,方便及时添加积分哟。

掘金翻译计划有自己的知乎专栏,你也可以投稿哈,推荐使用一个好用的插件
专栏地址:https://zhuanlan.zhihu.com/juejinfanyi

@Ashira97
Copy link
Contributor Author

Ashira97 commented Mar 3, 2021

@lsvih 您好~ 已发布~ https://juejin.cn/post/6935232492299354120/

@lsvih
Copy link
Member

lsvih commented Mar 3, 2021

收到

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

代码可视化 - 使用图技术为 Python 项目绘制结构图
4 participants