|
Thank u Luc Pattyn that is a good idea
|
|
|
|
|
you're welcome.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Luc Pattyn wrote: However if you want to store metadata (such as noun/verb/...), you would have to define a class or struct Word, and then your dictionary becomes a Dictionary<word, list<word="">>
This is less than optimal. In a large dictionary you'd have massive duplication in the List<word>'s. Probably the best option would be to do 2 dictionary<>'s and create a key/ID for the english words.
Dictionary<Word, List<int>> TranslationDictionary;
Dictionary<int, Word> EnglishDictionary;
The latest nation. Procrastination.
|
|
|
|
|
I agree.
BTW: Are you aware you inverted the translation? is there a reason for that?
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Of course I did. It's so I could... err... in order to... uhhh... because it's... FRIDAY!
The latest nation. Procrastination.
|
|
|
|
|
that's OK then
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
If you're worried about dupliaction, use a spell check tree.
|
|
|
|
|
|
That makes perfect sense.
However isn't it rather silly not to store a dictionary in a Dictionary?
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
That depends on if you need to be able to search on more than one parameter of each record.
The latest nation. Procrastination.
|
|
|
|
|
I read "store" as "persist".
|
|
|
|
|
Contains all words in the English language.
string[] dictionary = new string[] {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};
Of course some assembly is required.
only two letters away from being an asset
|
|
|
|
|
Hi,
I am having a custom class which is of type array.
one of its elements is date.
I want all elements of this class to be be sorted on basis of date.
e.g
Class Payment
{
date;
amount;
order;
}
Another calss
{
Payment[] pay=new Payment[4];
for(int i=0;i<3;i++)
{
pay[i]=new Payment();
pay[i].date="Monday";
pay[i].amount=5;
pay[i].order=abc;
}
//sort pay as per date that is populated in pay
say pay[0].date=Monday;
pay[1].date=Wednesday;
pay[2].date=Tuesday;
I want the entire row of pay to be sorted on basis of date.
}
Thanks,
Mini
Best Regards,
Mini Thomas
|
|
|
|
|
Hi,
this[^] explains how to sort all kinds of collections.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Populate a list with the array content.
Create a custom Comparer that compares two payment objects based on date.
Use the Sort method to sort the elements of the list.
If you need so, convert back the list to an array.
|
|
|
|
|
Mirko1980 wrote: Populate a list with the array content.
Why? don't you like public static void Sort(Array array, IComparer comparer) ?
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Nothing, only I didn't think about it
|
|
|
|
|
Hi Guys,
I have alerady tried with IComparable
but it doesn't return sorted array, maybe I am implementing in the wrong way.
Can you guys help me out with the exact implementation?
This payment Array is being accessed in another class say PaymentHistory and I wanna sort as per date the Payment array in PaymentHistory class.
Best Regards,
Mini Thomas
|
|
|
|
|
What have you tried? IComparable alone does not sort anything.
Are you using Array.Sort? Or a List?
Post the code you are using.
|
|
|
|
|
hi friends.
is there anyone who is knows, how to i learn an email server is pop3 mail server or not?
viva la commune
|
|
|
|
|
Poke it with a TCP connection, if it's a POP3 server it should tell you that as soon as it is connected
|
|
|
|
|
harold aptroot wrote: Poke it with a TCP connection
Poking it might just make it angry and it could POP you.
only two letters away from being an asset
|
|
|
|
|
|
Can anyone tell me what version of C# is installed with Visual Studio 2005? I tried looking at VS help and googled the question with no luck.
|
|
|
|
|
Hi,
I guess it's .NET 2.0, since you can see it's combined with Visual Studio 2005, well, for example, look at the right side of this page[].
|
|
|
|