-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathlatex.cpp
More file actions
44 lines (40 loc) · 1.32 KB
/
Copy pathlatex.cpp
File metadata and controls
44 lines (40 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "latex.h"
#include "Signature.h"
#include "WordCollection.h"
latex::latex() {}
QStringList latex::tabular_beginning(QString alignments){
line_list.clear();
line_list << "\\begin{center}";
line_list << "\\begin{tabular}" + alignments;
return line_list;
}
QStringList latex::tabular_ending(){
line_list << "\\end{tabular}";
line_list << "\\end{center}";
return line_list;
}
// not needed; replaced by CSignature function
QStringList latex::tabular(CSignature* sig){
QStringList temp;
temp << sig->get_key();
temp << QString::number(sig->get_stems()->count());
temp << QString::number(sig->get_robustness());
temp << QString::number(sig->get_stem_entropy());
temp << QString::number(sig->get_number_of_affixes());
line_list.append(temp.join(" & "));
return line_list;
}
QStringList latex::tabular_word_counts( CWordCollection* words, int number_of_columns ){
QStringList temp;
int colno = 0;
for (int n = 0; n< words->get_count(); n++) {
CWord* word = words->get_word(n);
temp << word->get_key() << QString::number(word->count());
if (colno == number_of_columns || n == words->get_word_count() ){
line_list.append (temp.join(" & ") + " \\\\");
temp.clear();
colno = 0;
}
}
return line_list;
}