問題タブ [profanity]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
4 に答える
323 参照

regex - 単語境界の末尾にあるアスタリスク * 文字に一致 \b

検閲された冒とく的な表現の使用を検出する軽量ツールを構築する際に、単語境界の末尾にある特殊文字を検出するのが非常に難しいことに気付きました。

文字列のタプルを使用して、OR された単語境界の正規表現を作成します。

問題は、*が単語境界の隣で検出できるものではないことです\b

特殊文字で終わるフレーズをサポートする便利な方法でこれを設定するためのアイデアはありますか?

0 投票する
1 に答える
1010 参照

python - Python でテキスト ファイルから不適切な単語を除外する

テキスト ファイルの内容を読み取り、そこから不適切な単語を除外したいと考えています。{UPDATED} それで、あなたが私に言ったことの後に私の python ファイルを更新しましたが、現在、モジュールなしのエラーが発生しています。pip3 install profanity_filter を実行すると、大きなエラーが発生します。ここに画像の説明を入力

Profanity を調査して見つけましたが、機能していません

ファイルを実行しようとしたときに表示されるエラーは次のとおりです ここに画像の説明を入力

0 投票する
1 に答える
64 参照

c# - あるクラスから別のクラスの変数にアクセスする

ファイル「b」でファイル「a」の変数を使用したい。オンラインで少し検索しましたが、まだ機能しません。

だから私はファイルbot.csとファイルを手に入れましたprofanityFilter.cs

でfromprofanityFilter.csを使いたい。incomingMessagebot.cs

bot.cs:

profanityFilter.cs:

しかし、このスクリーンショットに示されているエラーが表示されます。

ここに画像の説明を入力

0 投票する
1 に答える
795 参照

javascript - Profanity Filter with ReactJS

Consider the following code:

This is supposed to be a profanity filter. The theory is that it takes input from the text area and then uses the .map() and .includes() function to compare.

swear is an array it includes some bad word.

So the map loops over the swear array, picks up each word and see if it is included in the text. If returns true it console logs (Bad word found). If not it logs(No bad word found)

The issue is that when I click the button, it logs 13 times the not required result and then logs once the required result followed by more non required result. See the image below.

What is the turnabout solution for this??