小编use*_*293的帖子

如何从字符串中删除所有标点符号?

从字符串中删除所有标点符号,x.我想使用re.findall(),但我一直在努力知道该怎么写吧..我知道我能得到所有通过书面标点符号:

import string
y = string.punctuation
Run Code Online (Sandbox Code Playgroud)

但如果我写:

re.findall(y,x) 
Run Code Online (Sandbox Code Playgroud)

它说:

 raise error("multiple repeat")
 sre_constants.error: multiple repeat
Run Code Online (Sandbox Code Playgroud)

有人可以解释我们应该在re.findall函数中写出什么?

python regex string punctuation

1
推荐指数
2
解决办法
608
查看次数

BCNF分解算法说明

我看了将一个关系分解为BCNF答案,并在作业中进行了尝试,但是我没有得到正确的答案,所以我寻求BCNF分解的帮助

考虑R=(ABCDEG)F={BG->CD, G->A, CD->AE, C->AG, A->D}
我开始选择A->D
现在S=(AD), R'=(ABCEG).
我选了G->A
现在我明白了S=(AD,AG) R'=(BCEG)
我选C->G。现在我想我需要得到S=(AD,AG,CG)R'=(BCE),但最终答案(AD,AG,CGE,BC)。什么出了问题?还是更好的算法?

database decomposition functional-dependencies bcnf

1
推荐指数
1
解决办法
3547
查看次数