Flex - compare string without considering the accents - string

I have a compare routine ... but I need it to understand that when i search a "e" I also search for "é" or "è".
Is there an esay way to do that or do I really need to search and replace every accentued caractere before comparing ?
Thanks

You have to search and replace for every character since they are entirely different and no language will be able to figure out which characters you want to replace with what. Remember, programming languages don't speak english, they speak 010101 :)
Depending on the language you want to do this in, you may want to consider googling for a pre-existing library or plugin.

Related

Internationalization Web Number-Symbols

do I need to use another number-symbols when I want my webpage to be accessible in other countries? According to Microsoft there are different shape of numbers: https://learn.microsoft.com/en-us/globalization/locale/number-formatting#:~:text=formatting%20for%20details.-,The%20character%20used%20as%20the%20thousands%20separator,thousands%20separator%20is%20a%20space.
I have been searching since a few days to get a clear answer but I cant find some. Also, on most international websites/apps I only ever see the digits 0,1,2,3,4,5,6,7,8,9 although the digits for the language actually look different. That unsettles me. I feel like many websites/apps just ignore this fact. Can anybody help me further? Also do I need to know how to activate foreign symbols in html?
I do not know for sure what language you are translating/typing in HTML. But here is an example of what you can use as a guide to certain scripts in Arabic: https://sites.psu.edu/symbolcodes/languages/mideast/arabic/arabicchart/
You may also need to use a converter. For example, I type Chinese on my website by typing the characters into a character to unicode converter. Then I copy and paste the unicode to my HTML text.

Is there a way of doing a Fuzzy Search that regards to key codes?

Basically I want to implement a fuzzy search that disregards language!
For example - let's say that there's an entry for "Hello World".
Now, I want this to work with:
"hello"
"henlp"
"руддщ" (these are the Russian characters if you try to type "hello" but forget to switch to English)
"рутдз" (same as above but with "henlp" instead of "hello")
"יקמךם" (same as above but in Hebrew)
etc.
Now the things that makes most sense to me is to ignore the actual text and regard their relevant keyCodes, which all obviously work universally).
I did thought about for each entry, saving an array which represents all key codes - and then implement fuzziness based on the already given keyCodes instead of chars, but that feels like I'm doing something wrong, or missing something that already exists.
So, from what I've gathered there's no implementation of fuzzy search that regards this.
Is there maybe an alogrithm (other than fuzzy search) that already regards this which I'm missing?
Currently trying to implement in Node.js but open for more languages and frameworks

How can automate text rewriting?

I will explain what I wanna do.
If I have a text like "go there Jack" and I wanna automate rewriting it as "Jack went there".
Let's imagine it's a lengthy text over thousands of lines and has a fixed format over time like "go there Jonh", "go there Joe", "go there Smith".. etc (these are just imaginary examples but the text is not much different).
So i wanna ask is there a tool or a programming language library to automate such task ?
NB: " i have heard about text filters in linux but google didn't help me"
Mmm, I'd say go with some kind of scripting language for something like that. Try Python. Also, depending on how complex these patterns get you might want to look into Regular Expressions. so python+regular expressions imho.
If the text has fixed text as go there <name> then you can use regular expression to do a match with /go there (.*)/i and create new string using the matched string + ' went there'
It helps if you specify which language you are using so an example can be given.

Intelligent file search for windows that can ignore whitespace and search in code?

Does anybody know a Windows based searching tool that is easy to use and is programmer
friendly.
The functions I am looking for:
Ignore white space in search
= capable to find
myTestFunction ( $parameter, $another_parameter, $yet_another_parameter )
{ doThis();
using the query
myTestFunction($parameter,$another_parameter,$yet_another_parameter){doThis();
without Regexes.
Search code "semantically" (for me, it would have to be PHP):
Search in comments only
Search in function names only
Search for parameters that are named $xyz
Search in (insert code construct here) only
If there is none around, it's high time somebody developed it! :)
I have opened a bounty for this.
See our SD Search Engine. This is a language-sensitive search engine designed to search large code bases, with special language classifiers for C, C++, Java, C#, COBOL, JavaScript, Ada, Python, Ruby and lot of other languages, including your specific target langauge PHP (PHP4 and PHP5).
I think it does everything you requested.
It indexes the language elements so search across large code bases are extremely fast (Linux Kernal ~~ 7.5 Million lines --> 2.5 seconds). (The indexing step runs
on Windows, but the display engine is in Java.)
Search hits are shown in one-line context hit window showing the file and line number, as well as the line with the hit highlighted. Clicks on hits bring up the source code, tabs expanded appropriately, and the line count right even for languages which have odd line counting rules (such as GCC WRT form characters), with the hit line and hit text highlighted. Clicking in the source window will launch your favorite editor on the file.
Because it understands language elements, it ignores language-specific whitespace. It skips over comments unless you insist they be inspected. Searches thus ignore whitespace, comments and lineboundaries (if the language thinks lineboundaries are whitespace, which is why there are langauge-specific scanners). The query language allows you to specify which language tokens you want (specific tokens in quotes, or generic tokens such as identifiers I, numbers N, strings S, operators O and punctuation P) with constraints on the token value as well as a series of tokens.
Your example search:
myTestFunction($parameter,$another_parameter,$yet_another_parameter){doThis();
would be expressed to the search engine precisely as:
I=myTestFunction '(' I ',' I ',' I ')' '{' I=dothis '(' ')' ';'
but it would probably be easier (less typing) to find it as:
I=myTest* ... I=dothis
where I=myTest* means an identifier starting with myTest and ... means "near".
The Search Engine also offer regular expressions searches on the text, if you insist.
So you still have grep-like searches (a lot slower than indexed searches)
but with the hit window and source display windows too.
I use ack really successfully for this kind of thing, particularly when trying to find things in large codebases. I run it linux myself but I don't see any reason why it won't run on windows or in Cygwin at the very least. Check it out, I think you'll find it is exactly what you're looking for.
Search code "semantically" (for me, it would have to be PHP):
For this you could (and I think should) use some custom code using token_get_all()
See also the available tokens
Ignore white space in search
A simple regex should be sufficient. It depends on your regex-library, but most come with a whitespace modifier/flag.
For my Windows desktop search, I use Agent Ransack. I use this as a replacement for the windows search.
You can use regular expressions, but there is a nice entry screen if you want to avoid entering them directly.
Take a look at Google Desktop API, it has very powerful set of methods to do what you're looking for.
Of course it requires you to have the Google Desktop installed.
After reviewing it a little, it provides some functionality but not that specific as what you require.
I really like Crimson Editor and it allows RegEx searches. It has helped me a bunch over the past six years. I think it will fit your needs. Try it.
I use TextPad for searching code files in Windows. It has a very handy find-in-files function (Search / Find In Files) and you can use regex which should meet any search requirements. In the search results it will list the file location, line number and a snippet from that line.

How do I search Google for code and other programming related keywords? It seems to strip special characters

One of the problems I have with Google is that it seems to strip special characters like dots, commas and some other special characters, which are usually what I'm looking for when I'm trying to find anything programming-related
ex: django # sign returns irrelevant data. Perhaps you know a way (or an alternative/technique) to make this possible?
Related Questions
Effective Googling for short names
Why would M# be harder to Google than C#?
If you're looking for actual code examples, you can try code.google.com. Otherwise, the safest bet is to find the main website for whatever language you've got questions about and look around there, although a little digging is likely to turn it up on google.
Have you tried http://www.google.com/codesearch?

Resources