0
Follow
0
View

When calculating text similarity, each file in the folder needs to be calculated separately

a416676966 注册会员
2023-02-28 04:52

So what's the problem? Does the path not exist or is the file not finished traversing?

dragon4cn 注册会员
2023-02-28 04:52

Hello, there will be such a problem ah, thank you!

img

a15545520040 注册会员
2023-02-28 04:52

First the standardization(filename) function needs to be passed in a file path, such as filename

in the following code
def standardization(filename):
    data=''
    with open(filename,'r',encoding='utf-8') as f:
        for line in f.readlines():
            line=line.strip('\n')
            data+=line
        return data

img

cuimannuo 注册会员
2023-02-28 04:52

Thank you!! Solved the problem

About the Author

Question Info

Publish Time
2023-02-28 04:52
Update Time
2023-02-28 04:52

Related Question

来自文本框的TextChanged事件不按顺序出现

如何查看用户是否在MUI中单击了一个TextField

itextpdf5 字体粗细怎么设置

在R中的数据帧上使用ifelse或case_when

如何在服务中使用reactContext和getJSModule ?

itext7 转换svg为pdf

如何创建小TextField

在ggbox plot中使用:stat_summary(geom = 'text', label =字母

Is it possible to traverse through broadcast object when building glass literals with generics?

如何使它影响设备字体大小RichText和TextSpan