コンテンツへスキップ
🛠️ToolsShed

重複単語検索ツール

テキスト内の繰り返し単語を頻度数と位置で検索します。

このツールについて

重複単語検索ツールは、任意のテキスト内の繰り返される単語を特定して強調表示し、その頻度カウントと正確な位置を表示するツールです。重複単語を検出することは、執筆品質を向上させ、単語選択の多様性を確保し、散文が不自然または冗長に感じられる原因となる意図しない繰り返しを見つけたいと考えるライター、編集者、コンテンツクリエイター にとって価値があります。

テキストを入力フィールドに貼り付けるか入力するだけで、ツールがすぐに分析して繰り返されるすべての単語を検出します。結果は、各重複単語、その出現回数、およびテキスト内での位置を示す明確なテーブルで表示されます。これにより、繰り返しを簡単に確認でき、各インスタンスが目的を果たしているか、より良い流れと読みやすさのために同義語に置き換えるべきかを決定できます。

このツールは特に小説家、ジャーナリスト、学術的なライター、執筆を出版用に磨きたい誰もにとって便利です。ブログ記事、論文、またはマーケティングコピーを編集している場合でも、重複単語検索ツールは意図しない単語パターンを特定し、読者の注意を引きつける専門的で魅力的な散文を維持するのに役立ちます。

よくある質問

コード実装

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.