Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1920,23 +1920,21 @@ class DocumentCheckResultsFormatter:
|
|
1920 |
# Handle unused acronym issues
|
1921 |
if issue.get('type') == 'unused_acronym':
|
1922 |
return textwrap.fill(
|
1923 |
-
f"Acronym '{issue['acronym']}' defined but not used again after definition.",
|
1924 |
width=76,
|
1925 |
-
initial_indent=' • ',
|
1926 |
subsequent_indent=' '
|
1927 |
)
|
1928 |
# Handle undefined acronym issues
|
1929 |
-
|
1930 |
return textwrap.fill(
|
1931 |
-
f"Undefined acronym '{issue['acronym']}' used in: {issue['sentence']}",
|
1932 |
width=76,
|
1933 |
-
initial_indent=' • ',
|
1934 |
subsequent_indent=' '
|
1935 |
)
|
1936 |
# Handle other issues with sentence
|
1937 |
elif 'sentence' in issue:
|
1938 |
return textwrap.fill(
|
1939 |
-
|
1940 |
width=76,
|
1941 |
initial_indent=' • ',
|
1942 |
subsequent_indent=' '
|
@@ -1954,9 +1952,8 @@ class DocumentCheckResultsFormatter:
|
|
1954 |
examples.append(str(occ))
|
1955 |
occurrences_text = '; '.join(examples)
|
1956 |
return textwrap.fill(
|
1957 |
-
f"{issue['description']} - Examples: {occurrences_text}",
|
1958 |
width=76,
|
1959 |
-
initial_indent=' • ',
|
1960 |
subsequent_indent=' '
|
1961 |
)
|
1962 |
else:
|
@@ -1968,7 +1965,6 @@ class DocumentCheckResultsFormatter:
|
|
1968 |
return f" • {'; '.join(message_parts)}"
|
1969 |
else:
|
1970 |
return f" • {str(issue)}"
|
1971 |
-
|
1972 |
|
1973 |
def format_results(self, results: Dict[str, Any], doc_type: str) -> str:
|
1974 |
"""
|
|
|
1920 |
# Handle unused acronym issues
|
1921 |
if issue.get('type') == 'unused_acronym':
|
1922 |
return textwrap.fill(
|
1923 |
+
f" • Acronym '{issue['acronym']}' defined but not used again after definition.",
|
1924 |
width=76,
|
|
|
1925 |
subsequent_indent=' '
|
1926 |
)
|
1927 |
# Handle undefined acronym issues
|
1928 |
+
if issue.get('type') == 'undefined_acronym':
|
1929 |
return textwrap.fill(
|
1930 |
+
f" • Undefined acronym '{issue['acronym']}' used in: {issue['sentence']}",
|
1931 |
width=76,
|
|
|
1932 |
subsequent_indent=' '
|
1933 |
)
|
1934 |
# Handle other issues with sentence
|
1935 |
elif 'sentence' in issue:
|
1936 |
return textwrap.fill(
|
1937 |
+
issue['sentence'],
|
1938 |
width=76,
|
1939 |
initial_indent=' • ',
|
1940 |
subsequent_indent=' '
|
|
|
1952 |
examples.append(str(occ))
|
1953 |
occurrences_text = '; '.join(examples)
|
1954 |
return textwrap.fill(
|
1955 |
+
f" • {issue['description']} - Examples: {occurrences_text}",
|
1956 |
width=76,
|
|
|
1957 |
subsequent_indent=' '
|
1958 |
)
|
1959 |
else:
|
|
|
1965 |
return f" • {'; '.join(message_parts)}"
|
1966 |
else:
|
1967 |
return f" • {str(issue)}"
|
|
|
1968 |
|
1969 |
def format_results(self, results: Dict[str, Any], doc_type: str) -> str:
|
1970 |
"""
|