4

i am developing an urdu based application using c#. i have done with segmentation now problem is after segmentation i got letters of Urdu language any one give me idea how to join them to make words from letters like

  • ب ڑ ی = بڑی

  • ب ا ت = بات

J...
  • 30,968
  • 6
  • 66
  • 143
mashal
  • 37
  • 12
  • 1
    Is your question "how to use `String.Join` to join characters"? Your sample shows characters separated with spaces vs. same characters without spaces - so not very clear what exactly your problem is... Showing code you have problem with (and why it is any different from any other case like "a b c = abc") would make question much better. – Alexei Levenkov May 03 '14 at 18:14
  • 2
    @AlexeiLevenkov I believe OP is talking about ligatures that join letters and change their shape (ie: like Arabic, etc). Agree that we need to see the code that produces the problem. A good Urdu font should have many thousands of ligatures to properly render words. This may not be a programming problem so much as it is a font and layout problem. Most common fonts only support naskh type style, not nastaliq, if that's what this is about. – J... May 03 '14 at 18:20
  • No in urdu words combine to make words and i gave just an example with spaces there is no use of space. in segmentation i got a large number of alphabets i have to make valid words from these alphabets – mashal May 03 '14 at 18:22

1 Answers1

3

You should simply be able to concatenate letters into words. Just make sure there is no whitespace and the letters should join together properly automatically.

 string a = "ب";
 string b = "ڑ";
 string c = "ی";
 textBox1.Text = a + b + c;

produces :

enter image description here

J...
  • 30,968
  • 6
  • 66
  • 143
  • thanks it might be a solution but i need to check if the word is valid too after joining – mashal May 03 '14 at 18:35
  • @user3599590 you want to check it against a dictionary? Like spell checking? – J... May 03 '14 at 18:38
  • yes exactly it was so difficult to put in words but you got me right – mashal May 03 '14 at 18:40
  • 1
    @user3599590 Well, that is MUCH more difficult. I'm not sure if the Urdu localized MS Office supports this? Office interop might be an option. Otherwise I would look for 3rd party solutions - something like : http://www.cle.org.pk/software/langproc/spellcheck.htm <<- This is C++ but there is a DLL and API that you can use in C#. – J... May 03 '14 at 18:43
  • thanks a lot j.. your help is much appreciated.... – mashal May 03 '14 at 18:47