Duplicate Word Finder
텍스트의 반복 단어를 빈도 수와 위치로 찾습니다.
이 도구 소개
중복 단어 검색기는 모든 텍스트에서 반복되는 단어를 식별하고 강조 표시하며, 빈도 수 및 정확한 위치를 표시하는 도구입니다. 중복 단어를 감지하는 것은 글쓰기 품질을 개선하고, 단어 선택의 다양성을 보장하며, 산문을 어색하거나 중복적으로 느끼게 만드는 의도하지 않은 반복을 찾아내려는 작가, 편집자, 콘텐츠 크리에이터에게 유용합니다.
텍스트를 입력 필드에 붙여넣거나 입력하면 도구가 즉시 분석하여 반복되는 모든 단어를 찾습니다. 결과는 각 중복 단어, 그것이 나타나는 횟수, 텍스트에서의 위치를 보여주는 명확한 표로 표시됩니다. 이를 통해 반복을 쉽게 검토하고 각 인스턴스가 목적을 달성하는지 아니면 더 나은 흐름과 가독성을 위해 동의어로 바꿔야 하는지 결정할 수 있습니다.
이 도구는 특히 소설가, 저널리스트, 학술 저술가, 그리고 자신의 글을 출판용으로 다듬으려는 모든 사람에게 유용합니다. 블로그 포스트, 논문, 또는 마케팅 카피를 편집하든지 간에, 중복 단어 검색기는 의도하지 않은 단어 패턴을 식별하고 독자의 주의를 끌어내는 전문적이고 매력적인 산문을 유지하는 데 도움이 됩니다.
자주 묻는 질문
코드 구현
import re
from collections import Counter
def find_duplicates(text: str, case_sensitive: bool = False) -> dict:
"""Find duplicate words and their positions in text."""
processed = text if case_sensitive else text.lower()
words = re.findall(r'\b[a-zA-Z]+\b', processed)
freq = Counter(words)
duplicates = {word: count for word, count in freq.items() if count > 1}
# Find positions (1-based word index)
positions = {word: [] for word in duplicates}
for i, word in enumerate(words, 1):
if word in positions:
positions[word].append(i)
return {
'duplicates': sorted(duplicates.items(), key=lambda x: -x[1]),
'positions': positions,
'total_words': len(words),
'unique_words': len(freq),
}
text = "The cat sat on the mat and the cat was happy"
result = find_duplicates(text, case_sensitive=False)
for word, count in result['duplicates']:
print(f"'{word}' appears {count} times at positions {result['positions'][word]}")Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.