C
CFAN
I have a program,first it will read text from a text line by line and
then caculate the rank of each line. given word "good" it will give
the rank 50,
and "very good" rank 80.
and the declaration is something like the following,
class XXX{
std::vector<string> word_lists;
}
the word_lists contains the text in each line,and also i have defined
such type to contain the result of parsing
std::vector< <std:
air<int,int> > word_list_rank_table;
the first element in the pair indicates the subscript of the string in
the word_list,the second element indicates
the rank caculated,
and I need to sort the word_list_rank_table by the rank
the first question is does the std::vector< <std:
air<int,int> >
word_list_rank_table; suitable for this purpose
and the second question is how to sort it using STL algorithmn?
thanks
then caculate the rank of each line. given word "good" it will give
the rank 50,
and "very good" rank 80.
and the declaration is something like the following,
class XXX{
std::vector<string> word_lists;
}
the word_lists contains the text in each line,and also i have defined
such type to contain the result of parsing
std::vector< <std:
the first element in the pair indicates the subscript of the string in
the word_list,the second element indicates
the rank caculated,
and I need to sort the word_list_rank_table by the rank
the first question is does the std::vector< <std:
word_list_rank_table; suitable for this purpose
and the second question is how to sort it using STL algorithmn?
thanks