Improve topic sorting: add popular sorting by publications and authors count

This commit is contained in:
2025-06-02 02:56:11 +03:00
parent baca19a4d5
commit 3327976586
113 changed files with 7238 additions and 3739 deletions

View File

@@ -2,7 +2,7 @@ import re
from difflib import ndiff
def get_diff(original, modified):
def get_diff(original: str, modified: str) -> list[str]:
"""
Get the difference between two strings using difflib.
@@ -13,11 +13,10 @@ def get_diff(original, modified):
Returns:
A list of differences.
"""
diff = list(ndiff(original.split(), modified.split()))
return diff
return list(ndiff(original.split(), modified.split()))
def apply_diff(original, diff):
def apply_diff(original: str, diff: list[str]) -> str:
"""
Apply the difference to the original string.