ব্যবহারকারী:Johnuniq/sandbox
অবয়ব
Quick test for:
- Module:ইংরেজি শনাক্তকরণ • Module to highlight any English letters in input, and add a tracking category.
- Template:ইংরেজি সনাক্তকরণ • Template that invokes the module.
Input | Output | |
---|---|---|
{{englishdetect|Example}} | Example | |
{{englishdetect|Wiki উইকি}} | Wiki উইকি | |
{{englishdetect|উইকি}} | উইকি | |
{{englishdetect|উইকিWiki}} | উইকিWiki | |
{{englishdetect|উইকিWiki বাংলা}} | উইকিWiki বাংলা | |
{{englishdetect|1234567890 ১২৩৪৫৬৭৮৯০}} | 1234567890 ১২৩৪৫৬৭৮৯০ | |
{{englishdetect|.-*^?&% etc.}} | .-*^?&% etc. | |
{{englishdetect|1১২2}} | 1১২2 | |
{{englishdetect|a১২b}} | a১২b | |
{{englishdetect|a1১২b2}} | a1১২b2 | |
{{englishdetect|1a১২2b}} | 1a১২2b |
Points to think about:
- Input may include leading/trailing spaces that are preserved.
- Output is empty text if the input is empty.
- Tracking category is added regardless of namespace of page with template.
Johnuniq (আলাপ) ০৩:৩২, ১৭ ডিসেম্বর ২০১৫ (ইউটিসি)
Problem
[সম্পাদনা]I found a problem. It need to be fixed, otherwise i can't use Template:englishdetect via another template. Problem is: when i give any wikilink in english, Template:englishdetect unlink that wikilink. (see this exemple)
Input | Output | expected/should be |
---|---|---|
{{englishdetect|This is a [[Example]]}} | This is a Example | This is a Example |
{{englishdetect|This is a [[Example|Test]]}} | This is a Test | This is a Test |
{{englishdetect|[[Dhaka]] ([[Dhaka|Uttara]])}} | Dhaka (Uttara) | Dhaka (Uttara) |
Input | Output | expected/should be | |
---|---|---|---|
{{englishdetect|[[ঢাকা]], [[ঢাকা|উওরা]] ([[এক]])}} | ঢাকা, উওরা (এক) | ঢাকা, উওরা (এক) | :) |
আফতাব (আলাপ) ১৬:০৬, ১৭ ডিসেম্বর ২০১৫ (ইউটিসি)
- A program has to follow a set of rules, and the suggested solutions above may require too much intelligence from the module. Consider the input:
- Ages 12–18 are [[Example123]] more
- We can see that the best way to handle that is to put a single span around the whole text, but it would be hard to produce some rules which do that while also giving the results wanted in the previous examples. The problem is that while it is easy to detect English letters, there is no straight forward way of detecting Bangla characters. Please consider how englishdetect would be used and think about whether the following rules would work:
- If the input contains English letters and if the input contains "[[" then put a single span around the whole input.
- Otherwise, process as currently occurs, so spans are inserted around each sequence of English letters and the result may have several spans.
- Those rules are not ideal because the input "[[Dhaka|ঢাকা]] বাংলাদেশের" would have a span around the whole input. However, the rule would be simple and therefore reliable. Would that work? Johnuniq (আলাপ) ২৩:১০, ১৭ ডিসেম্বর ২০১৫ (ইউটিসি)
Problem 2
[সম্পাদনা]If i use <br>
or <small></small>
or <big></big>
inside this template, Module doesn't give correct result. And because of this there are many incorrect result
Input | Output | expected/should be |
---|---|---|
{{englishdetect|This is a <br>Example}} | This is a Example |
This is a Example |
{{englishdetect|This is a <big>Example</big>}} | This is a Example | This is a Example |
{{englishdetect|This is a <small>Example</small>)}} | This is a Example | This is a Example |
Is it possible to add something to ignore <br>
or <small></small>
or <big></big>
? আফতাব (আলাপ) ২২:৫৩, ১২ মে ২০১৮ (ইউটিসি)