ব্যবহারকারী:Johnuniq/sandbox: সংশোধিত সংস্করণের মধ্যে পার্থক্য

উইকিপিডিয়া, মুক্ত বিশ্বকোষ থেকে
বিষয়বস্তু বিয়োগ হয়েছে বিষয়বস্তু যোগ হয়েছে
সম্পাদনা সারাংশ নেই
Johnuniq (আলোচনা | অবদান)
→‎Problem: suggestion
৫৪ নং লাইন: ৫৪ নং লাইন:
|}
|}
[[ব্যবহারকারী:Aftabuzzaman|আফতাব]] ([[ব্যবহারকারী আলাপ:Aftabuzzaman|আলাপ]]) ১৬:০৬, ১৭ ডিসেম্বর ২০১৫ (ইউটিসি)
[[ব্যবহারকারী:Aftabuzzaman|আফতাব]] ([[ব্যবহারকারী আলাপ:Aftabuzzaman|আলাপ]]) ১৬:০৬, ১৭ ডিসেম্বর ২০১৫ (ইউটিসি)
: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:
::<nowiki>Ages 12–18 are [[Example123]] more</nowiki>
: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 "<nowiki>[[</nowiki>" 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 "<nowiki>[[Dhaka|ঢাকা]] বাংলাদেশের</nowiki>" would have a span around the whole input. However, the rule would be simple and therefore reliable. Would that work? [[ব্যবহারকারী:Johnuniq|Johnuniq]] ([[ব্যবহারকারী আলাপ:Johnuniq|আলাপ]]) ২৩:১০, ১৭ ডিসেম্বর ২০১৫ (ইউটিসি)

২৩:১০, ১৭ ডিসেম্বর ২০১৫ তারিখে সংশোধিত সংস্করণ

Quick test for:

Input Output
{{englishdetect|Example}} Example Green tickY
{{englishdetect|Wiki উইকি}} Wiki উইকি Green tickY
{{englishdetect|উইকি}} উইকি Green tickY
{{englishdetect|উইকিWiki}} উইকিWiki Green tickY
{{englishdetect|উইকিWiki বাংলা}} উইকিWiki বাংলা Green tickY
{{englishdetect|1234567890 ১২৩৪৫৬৭৮৯০}} 1234567890 ১২৩৪৫৬৭৮৯০ Green tickY
{{englishdetect|.-*^?&% etc.}} .-*^?&% etc. Green tickY
{{englishdetect|1১২2}} 1১২2 Green tickY
{{englishdetect|a১২b}} a১২b Green tickY
{{englishdetect|a1১২b2}} a1১২b2 Green tickY
{{englishdetect|1a১২2b}} 1a১২2b Green tickY

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|[[ঢাকা]], [[ঢাকা|উওরা]] ([[এক]])}} ঢাকা, উওরা (এক) ঢাকা, উওরা (এক) Green tickY :)

আফতাব (আলাপ) ১৬:০৬, ১৭ ডিসেম্বর ২০১৫ (ইউটিসি)

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 (আলাপ) ২৩:১০, ১৭ ডিসেম্বর ২০১৫ (ইউটিসি)