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

错失了最好的 content #120

Open
zlj-zz opened this issue Feb 26, 2022 · 1 comment
Open

错失了最好的 content #120

zlj-zz opened this issue Feb 26, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@zlj-zz
Copy link

zlj-zz commented Feb 26, 2022

bug的现象

内容标签 class=content,代码进行了加权。内容中只包含了 <br>,预处理后正文内容为纯字符串。

    def need_skip_ltgi(self, ti, lti):

        if lti == 0:
            return False

        return ti // lti > 10  # 正文的字符数量是链接字符数量的十倍以上

lti == 0 导致 density = 0,最终的分数为 0。最后从父级标签提取内容,包含了不必要的内容。

<div class="content1">
	我是正文我是正文我是正文
	<br />
	我是正文我是正文我是正文
	<br />
	我是正文我是正文我是正文
	<br />
	我是正文我是正文我是正文
	<br />
	我是正文我是正文我是正文
	<br />
</div>
@zlj-zz zlj-zz added the bug Something isn't working label Feb 26, 2022
@kingname
Copy link
Collaborator

kingname commented Feb 26, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants