Find the word from a string.

4 ビュー (過去 30 日間)
Balkar Singh
Balkar Singh 2020 年 4 月 15 日
コメント済み: Balkar Singh 2020 年 4 月 21 日
s1=hello everone (during the embedding process a watermark bit is embedded in the word)
s2=hello the everyone (By insertion attack 'the' word is inserted)
How can I find out that 'the' word is embedded during a attack and I also want to assign a 0 and 1 to the words. 0 indicates a new word and 1 presents a marked word.
Thanks in advance
  4 件のコメント
Balkar Singh
Balkar Singh 2020 年 4 月 15 日
Sorry strfind is not working as per my reqirement. Thanks
Stephen23
Stephen23 2020 年 4 月 15 日
編集済み: Stephen23 2020 年 4 月 15 日
Identifying character changes between two strings can be achieved using the Needleman-Wunsch algorithm:
You might find an implementation on FEX or online (but based on my experience implementing this algorithm in another language, it will be difficult to find a correct implentation).
If you want to resctrict yourself to matching whole words (so one different character means two words do not match), then you can simply split the strings up into words (e.g. strsplit, regexp), and then use ismember or something similar (one or two loops might be required).

サインインしてコメントする。

採用された回答

Sahithi Kanumarlapudi
Sahithi Kanumarlapudi 2020 年 4 月 21 日
Hi,
Using 'strcmp' you could get the indices of the words which are not matching as per your requirement stated in the question. For more information on how to compare strings using 'strcmp refer to the following links
If there is any other requirement, you could post it in the comments.
Hope this helps!
  1 件のコメント
Balkar Singh
Balkar Singh 2020 年 4 月 21 日
Thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by