first am using vb.net not c#, i tried convertin to vb.net using http://www.developerfusion.com/tools/convert/csharp-to-vb/[^], and i get many errors. Can you provide vb.net version?
Cool Smith
Posts
-
count character frequency -
count character frequencyhere are the links CodePage File Converter[^] Detect Encoding for In- and Outgoing Text[^] i'll try your implementation and and back to you. besides i found a hextostring code, will it work well for recognizing single characters in a joined character
Private Function ConvertStringToHex(ByVal MyString As String) As String Dim Result As String = vbNullString If Len(MyString) = 0 Then Result = vbNullString Else For i As Integer = 0 To Len(MyString.Trim) - 1 Dim MyChar As String = Mid(MyString.Trim, i + 1, 1) Result = Result + Xformat(Hex(Microsoft.VisualBasic.AscW(MyChar))) Next End If Return Result End Function Private Function ConvertHexToString(ByVal MyString As String) As String Dim Result As String = vbNullString If Len(MyString) = 0 Then Result = vbNullString Else For i As Integer = 0 To Len(MyString.Trim) - 1 Step 4 Dim MyChar As String = Mid(MyString.Trim, i + 1, 4) Result = Result + Microsoft.VisualBasic.ChrW(Convert.ToInt32(MyChar, 16)) Next End If Return Result End Function Function Xformat(ByVal xin As String) As String Dim retval As String = xin Select Case Len(xin) Case Is = 3 retval = "0" & xin Case Is = 2 retval = "00" & xin Case Is = 1 retval = "000" & xin End Select Return retval End Function End Class
-
count character frequencyWhat format is it in? Ideally, it'd be UTF. It's important since the encoding determines the length of a single character. Download a HEX-editor and open the textfile with it - what do the first bytes look like in HEX?
The this is, the software will be examining different text files (*.txt) only that contains arabic writings. i found code here that can detect the code page of a file and another that can convert between different code page.
First, determine the encoding, and read the file with that encoding. Then create a dictionary, read the entire file as a string. Loop through the string by eating characters, adding them to the dictionary as the key, or adding +1 to it's value if it's already in the dictionary. When done eating, burp out the results
can you give me pseudo code for this, i don't have any idea how to do it
-
count character frequencywhat i want to do is count the frequency of characters that appears in an Arabic text
-
count character frequency