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

这段代码有问题 Synonymous_dict是空 #3

Open
Clove-MJC opened this issue Jun 3, 2021 · 1 comment
Open

这段代码有问题 Synonymous_dict是空 #3

Clove-MJC opened this issue Jun 3, 2021 · 1 comment

Comments

@Clove-MJC
Copy link

def Synonymous_names(self):
'''
对于可能出现类似 贾宝玉、宝玉 两个名字都指同一个人的情况请按照

    贾宝玉
    宝玉

    这样的方式排列到小说角色文件中去
    '''
    
    Synonymous_dict= {}
    n = 0
    len_name_list = len(self._name_list)
    for i in  self._name_list:

        n += 1
        if len(i) > 2 :
            if n == len_name_list:
                print('- -||')
                break
            if i[1:] != self._name_list[n]:                    
                continue
            
            Synonymous_dict[self._name_list[n]] = i
    print('synoymous :\n{}'.format(Synonymous_dict))
    return Synonymous_dict
@zealotCE
Copy link
Owner

zealotCE commented Dec 7, 2021

可以的话,提交一个 pr 吧

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

No branches or pull requests

2 participants