代码拉取完成,页面将自动刷新
#ifndef TEXTANALYSIS_H
#define TEXTANALYSIS_H
#include "mostQtHeaders.h"
#include "ui_textanalysis.h"
#include "qdocumentcursor.h"
class QEditor;
class QDocument;
struct StructureEntry;
class ClsWord
{
public:
QString word;
int count;
ClsWord(): count(0) {}
ClsWord(QString nw, int nc);
bool operator<(const ClsWord &cmpTo) const;
};
class TextAnalysisModel : public QAbstractTableModel
{
Q_OBJECT
public:
QVector<ClsWord> words;
int wordCount, characterInWords;
float relativeProzentMultipler;
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
void updateAll();
bool hasChildren(const QModelIndex &parent = QModelIndex()) const;
};
class TextAnalysisDialog : public QDialog
{
Q_OBJECT
QVector<QPair<QString, int> > chapters;
QVector<QMap<QString, int> > maps[3]; //texts, commands, comments
QVector<int> lineCount[3]; //total line count, text lines, comment lines
TextAnalysisModel displayed;
const QDocument *document;
QEditor *editor;
QDocumentCursor cursor;
bool alreadyCount;
int lastSentenceLength, lastMinSentenceLength, lastParsedMinWordLength;
QString lastEndCharacters;
void needCount();
void insertDisplayData(const QMap<QString, int> &map);
public:
TextAnalysisDialog(QWidget *parent = 0, QString name = "");
~TextAnalysisDialog();
Ui::TextAnalysisDialog ui;
//void setData(const QDocument* doc, const QDocumentCursor &cur);
void setEditor(QEditor *aeditor);
void interpretStructureTree(StructureEntry *item);
private:
void interpretStructureTreeRec(StructureEntry *item, int targetLevel);
private slots:
void slotCount();
void slotClose();
void slotSelectionButton();
void slotExportButton();
void editorDestroyed();
public slots:
void init();
};
#endif // USERMENUDIALOG_H
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。