d3view 수정
git-svn-id: svn://192.168.0.12/source@177 8346c931-da38-4b9b-9d4c-e48b93cbd075
This commit is contained in:
@@ -34,7 +34,8 @@ SOURCES += main.cpp\
|
||||
ymfilter.cpp \
|
||||
ymfilterchildren.cpp \
|
||||
ymtwodepthwidget.cpp \
|
||||
ymuploadwidget.cpp
|
||||
ymuploadwidget.cpp \
|
||||
ymplatformwidget.cpp
|
||||
|
||||
|
||||
HEADERS += mainwindow.h \
|
||||
@@ -87,7 +88,8 @@ HEADERS += mainwindow.h \
|
||||
ymfilter.h \
|
||||
ymfilterchildren.h \
|
||||
ymtwodepthwidget.h \
|
||||
ymuploadwidget.h
|
||||
ymuploadwidget.h \
|
||||
ymplatformwidget.h
|
||||
|
||||
|
||||
FORMS += mainwindow.ui
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include <QSqlDatabase>
|
||||
#include <QSqlError>
|
||||
#include "ymtwodepthwidget.h"
|
||||
#include "ymplatformwidget.h"
|
||||
#include <QShortcut>
|
||||
#include <QKeySequence>
|
||||
#include <QUrl>
|
||||
@@ -70,6 +71,7 @@ MainWindow::MainWindow()
|
||||
m_pYMOneDepthWidget = new YMOneDepthWidget;
|
||||
m_pYMTwoDepthWidget = new YMTwoDepthWidget;
|
||||
m_pYMNxNMatrixWidget = new YMNxNMatrixWidget;
|
||||
m_pYMPlatformWidget = new YMPlatformWidget;
|
||||
p_qwDict = new SDictionary;
|
||||
|
||||
//p_qwAnalyzer1->setWidget(p_qwDB);
|
||||
@@ -93,13 +95,13 @@ MainWindow::MainWindow()
|
||||
m_ptwResult->addTab(m_pYMOneDepthWidget, "OneDepth");
|
||||
m_ptwResult->addTab(m_pYMTwoDepthWidget, "TwoDepth");
|
||||
m_ptwResult->addTab(m_pYMNxNMatrixWidget, "NxNMatrix");
|
||||
|
||||
m_ptwResult->addTab(m_pYMPlatformWidget, "Platform");
|
||||
|
||||
m_pYMBasicWidget->setTabWidget(m_ptwSource);
|
||||
m_pYMOneDepthWidget->setTabWidget(m_ptwSource);
|
||||
m_pYMTwoDepthWidget->setTabWidget(m_ptwSource);
|
||||
m_pYMNxNMatrixWidget->setTabWidget(m_ptwSource);
|
||||
|
||||
m_pYMPlatformWidget->setTabWidget(m_ptwSource);
|
||||
|
||||
m_pUploadWidget->setResultTabWidget(m_ptwResult);
|
||||
m_pUploadWidget->setSourceTabWidget(m_ptwSource);
|
||||
@@ -112,6 +114,11 @@ MainWindow::MainWindow()
|
||||
widget->setLayout(layout);
|
||||
//! [1]
|
||||
|
||||
actD3View = new QAction(tr("D3View"), this);
|
||||
actD3View->setShortcut(Qt::Key_0 | Qt::CTRL);
|
||||
connect(actD3View, SIGNAL(triggered()), this, SLOT(slotD3View()));
|
||||
this->addAction(actD3View);
|
||||
|
||||
//! [2]
|
||||
createActions();
|
||||
createMenus();
|
||||
@@ -120,11 +127,6 @@ MainWindow::MainWindow()
|
||||
statusBar()->showMessage(message);
|
||||
//test = new QWebView(this);
|
||||
|
||||
actD3View = new QAction(tr("D3View"), this);
|
||||
actD3View->setShortcut(Qt::Key_0 | Qt::CTRL);
|
||||
connect(actD3View, SIGNAL(triggered()), this, SLOT(slotD3View()));
|
||||
this->addAction(actD3View);
|
||||
|
||||
setWindowTitle(tr("Morphere Analyzer"));
|
||||
setMinimumSize(800, 600);
|
||||
resize(800, 600);
|
||||
@@ -221,6 +223,9 @@ void MainWindow::createMenus()
|
||||
menuShowUpload = menuBar()->addMenu(tr("ShowUpload"));
|
||||
menuShowUpload->addAction(actShowUpload);
|
||||
|
||||
menuD3View = menuBar()->addMenu(tr("D3View"));
|
||||
menuD3View->addAction(actD3View);
|
||||
|
||||
}
|
||||
//! [12]
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ private:
|
||||
YMorphereWidget *m_pYMOneDepthWidget;
|
||||
YMorphereWidget *m_pYMNxNMatrixWidget;
|
||||
YMorphereWidget *m_pYMTwoDepthWidget;
|
||||
|
||||
YMorphereWidget *m_pYMPlatformWidget;
|
||||
|
||||
QAction *actDBNew;
|
||||
QAction *actDBCsvImport;
|
||||
@@ -139,6 +139,8 @@ private:
|
||||
QMenu *menuDictionary;
|
||||
QMenu *menuTestUpload;
|
||||
QMenu *menuShowUpload;
|
||||
QMenu *menuD3View;
|
||||
|
||||
|
||||
QAction *actD3View;
|
||||
QAction *actShowUpload;
|
||||
|
||||
@@ -1569,7 +1569,7 @@ void Widget::FileImport()
|
||||
|
||||
for(int i = 0; i < m_vecColumn.size(); i++)
|
||||
{
|
||||
strlistHeader << m_vecColumn.at(i).at(E_COLUMN_DATABASE);
|
||||
strlistHeader << m_vecColumn.at(i).at(E_COLUMN_NAME);
|
||||
}
|
||||
|
||||
|
||||
@@ -1600,7 +1600,7 @@ void Widget::FileImport()
|
||||
{
|
||||
if (strlistHeader.contains(strings.at(i)))
|
||||
{
|
||||
if (m_vecColumn.at(j).at(E_COLUMN_DATABASE) == strings.at(i).trimmed())
|
||||
if (m_vecColumn.at(j).at(E_COLUMN_NAME) == strings.at(i).trimmed())
|
||||
{
|
||||
wgHeader << j;
|
||||
}
|
||||
@@ -1660,7 +1660,7 @@ void Widget::FileExport()
|
||||
out << "#Head#,";
|
||||
|
||||
foreach(QStringList strList,m_vecColumn)
|
||||
out << strList.at(E_COLUMN_DATABASE) << ",";
|
||||
out << strList.at(E_COLUMN_NAME) << ",";
|
||||
out << endl;
|
||||
|
||||
m_pProgress->setRange(0,pCurrent->rowCount()-1);
|
||||
|
||||
@@ -77,6 +77,12 @@ YAlgorithm* YAFactory::getYAlgorithm(QMap<QString, QString> mapParam)
|
||||
m_mapAlgorithm.insert("basic", new YAlgorithm());
|
||||
Algorithm = m_mapAlgorithm.value("basic");
|
||||
}
|
||||
else if(mapParam.value("Algorithm").compare("platform", Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
if(!m_mapAlgorithm.contains("platform"))
|
||||
m_mapAlgorithm.insert("platform", new YPlatformAlgorithm());
|
||||
Algorithm = m_mapAlgorithm.value("platform");
|
||||
}
|
||||
else
|
||||
{
|
||||
Algorithm = NULL;
|
||||
@@ -379,3 +385,135 @@ void YTwoDepthAlgorithm::Start()
|
||||
}
|
||||
|
||||
|
||||
void YPlatformAlgorithm::Start()
|
||||
{
|
||||
if(m_mapParam.isEmpty())
|
||||
return;
|
||||
|
||||
bool okThread = false;
|
||||
int nThread = m_mapParam.value("Thread").trimmed().toInt(&okThread);
|
||||
|
||||
if(!okThread)
|
||||
setThreadNumber(1);
|
||||
else
|
||||
setThreadNumber(nThread);
|
||||
|
||||
QMap<QString, QString>mapParam = m_mapParam;
|
||||
|
||||
mapParam["Algorithm"] = "platformone";
|
||||
|
||||
|
||||
m_pYMThread = new YMorphereThread*[getThreadNumber()];
|
||||
for(int i = 0; i < getThreadNumber(); i++)
|
||||
{
|
||||
m_pYMThread[i] = ThreadFactory::getThread(mapParam);
|
||||
m_pYMThread[i]->setDataAlgorithmInterface(m_pDAInterface);
|
||||
m_pYMThread[i]->setMutex(&mutex);
|
||||
m_pYMThread[i]->setParam(mapParam);
|
||||
}
|
||||
for(int i = 0;i < getThreadNumber(); i++)
|
||||
{
|
||||
m_pYMThread[i]->start();
|
||||
}
|
||||
for(int i = 0;i < getThreadNumber(); i++)
|
||||
{
|
||||
m_pYMThread[i]->wait();
|
||||
}
|
||||
|
||||
m_mapThreadResult = new QMap<QString, int>*[getThreadNumber()];
|
||||
for(int i = 0; i < getThreadNumber(); i++)
|
||||
{
|
||||
m_mapThreadResult[i] = new QMap<QString, int>();
|
||||
}
|
||||
for(int i = 0; i < getThreadNumber(); i++)
|
||||
{
|
||||
*m_mapThreadResult[i] = m_pYMThread[i]->getResult();
|
||||
m_pYMThread[i]->clearResult();
|
||||
}
|
||||
|
||||
for(int i = 0;i < getThreadNumber(); i++)
|
||||
{
|
||||
delete m_pYMThread[i];
|
||||
}
|
||||
delete[] m_pYMThread;
|
||||
|
||||
EmergeThreadResult();
|
||||
|
||||
YMFilter* ymfilter = YMFilterFactory::getFilter(mapParam);
|
||||
//qDebug() << "EXEC";
|
||||
if(ymfilter != NULL)
|
||||
{
|
||||
ymfilter->setParam(m_mapParam);
|
||||
m_mapTotalResult = ymfilter->Exec(m_mapTotalResult);
|
||||
}
|
||||
delete ymfilter;
|
||||
|
||||
|
||||
|
||||
|
||||
QList<QString> listKeys = m_mapTotalResult.keys();
|
||||
|
||||
QString strKeys;
|
||||
|
||||
for(int i = 0; i < listKeys.count(); i++)
|
||||
{
|
||||
strKeys += (listKeys.at(i).trimmed() + " ");
|
||||
}
|
||||
|
||||
strKeys = strKeys.trimmed();
|
||||
|
||||
m_mapTotalResult.clear();
|
||||
|
||||
m_mapParam.insert("OneDepthKeys", strKeys);
|
||||
m_pDAInterface->reset();
|
||||
m_pYMThread = new YMorphereThread*[getThreadNumber()];
|
||||
for(int i = 0; i < getThreadNumber(); i++)
|
||||
{
|
||||
m_pYMThread[i] = ThreadFactory::getThread(m_mapParam);
|
||||
m_pYMThread[i]->setDataAlgorithmInterface(m_pDAInterface);
|
||||
m_pYMThread[i]->setMutex(&mutex);
|
||||
m_pYMThread[i]->setParam(m_mapParam);
|
||||
}
|
||||
for(int i = 0;i < getThreadNumber(); i++)
|
||||
{
|
||||
m_pYMThread[i]->start();
|
||||
}
|
||||
for(int i = 0;i < getThreadNumber(); i++)
|
||||
{
|
||||
m_pYMThread[i]->wait();
|
||||
}
|
||||
|
||||
m_mapThreadResult = new QMap<QString, int>*[getThreadNumber()];
|
||||
for(int i = 0; i < getThreadNumber(); i++)
|
||||
{
|
||||
m_mapThreadResult[i] = new QMap<QString, int>();
|
||||
}
|
||||
for(int i = 0; i < getThreadNumber(); i++)
|
||||
{
|
||||
*m_mapThreadResult[i] = m_pYMThread[i]->getResult();
|
||||
m_pYMThread[i]->clearResult();
|
||||
}
|
||||
|
||||
for(int i = 0;i < getThreadNumber(); i++)
|
||||
{
|
||||
delete m_pYMThread[i];
|
||||
}
|
||||
delete[] m_pYMThread;
|
||||
|
||||
EmergeThreadResult();
|
||||
|
||||
ymfilter = YMFilterFactory::getFilter(m_mapParam);
|
||||
//qDebug() << "EXEC";
|
||||
if(ymfilter != NULL)
|
||||
{
|
||||
qDebug() << "totalresult: " << m_mapTotalResult.size();
|
||||
ymfilter->setParam(m_mapParam);
|
||||
m_mapTotalResult = ymfilter->Exec(m_mapTotalResult);
|
||||
}
|
||||
delete ymfilter;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -68,5 +68,12 @@ public:
|
||||
void Start();
|
||||
};
|
||||
|
||||
class YPlatformAlgorithm:public YAlgorithm
|
||||
{
|
||||
public:
|
||||
void Start();
|
||||
};
|
||||
|
||||
|
||||
#endif // YALGORITHM
|
||||
|
||||
|
||||
@@ -19,6 +19,10 @@ YMorphereThread* ThreadFactory::getThread(QMap<QString, QString> mapParam)
|
||||
{
|
||||
return new YTwoDepthMThread();
|
||||
}
|
||||
else if(mapParam.value("Algorithm").trimmed().compare("platformone", Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
return new YPlatformOneMThread();
|
||||
}
|
||||
else if(mapParam.value("Algorithm").trimmed().compare("platform", Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
return new YPlatformMThread();
|
||||
@@ -1072,18 +1076,6 @@ void YTwoDepthMThread::parseParam()
|
||||
}
|
||||
|
||||
|
||||
|
||||
void YPlatformMThread::run()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void YPlatformMThread::parseParam()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void YIDMThread::run()
|
||||
{
|
||||
|
||||
@@ -1362,3 +1354,729 @@ void YNNMatrixMThread::parseParam()
|
||||
}
|
||||
|
||||
|
||||
|
||||
void YPlatformOneMThread::parseParam()
|
||||
{
|
||||
|
||||
userdict = m_mapParam.value("UserDict");
|
||||
|
||||
m_nArticle = m_mapParam.value("Article").toInt();
|
||||
|
||||
m_nTitleBody = m_mapParam.value("TitleBody").toInt();
|
||||
m_nPeriod = m_mapParam.value("Period").toInt();
|
||||
|
||||
m_nDateStart = m_mapParam.value("DateStart").toInt();
|
||||
m_nDateEnd = m_mapParam.value("DateEnd").toInt();
|
||||
|
||||
m_bDateAll = true;
|
||||
|
||||
if(m_mapParam.value("DateALL") == "true")
|
||||
m_bDateAll = true;
|
||||
else
|
||||
m_bDateAll = false;
|
||||
|
||||
m_slMorphereList = m_mapParam.value("MorphereList").split(" ");
|
||||
|
||||
m_strCKeyword = m_mapParam.value("CenterKeyword").trimmed();
|
||||
if(m_mapParam.value("CountMethod") == "Duplicate")
|
||||
m_bDuplicate = true;
|
||||
else
|
||||
m_bDuplicate = false;
|
||||
|
||||
m_strRecentPeriod = m_mapParam.value("RecentPeriod").trimmed();
|
||||
|
||||
if(m_strRecentPeriod == "None")
|
||||
{
|
||||
|
||||
}
|
||||
else if(m_strRecentPeriod == "Days")
|
||||
{
|
||||
int nDate = m_mapParam.value("RecentDate").trimmed().toInt();
|
||||
QDateTime today = QDateTime::currentDateTime();
|
||||
QDateTime startday = today.addDays(-(nDate));
|
||||
startday = startday.addDays(1);
|
||||
m_nDateStart = startday.toString("yyyyMMdd").trimmed().toInt();
|
||||
m_nDateEnd = today.toString("yyyyMMdd").trimmed().toInt();
|
||||
m_bDateAll = false;
|
||||
}
|
||||
else if(m_strRecentPeriod == "Weeks")
|
||||
{
|
||||
int nDate = m_mapParam.value("RecentDate").trimmed().toInt();
|
||||
QDateTime today = QDateTime::currentDateTime();
|
||||
QDateTime startday = today.addDays(-(nDate*7));
|
||||
startday = startday.addDays(1);
|
||||
m_nDateStart = startday.toString("yyyyMMdd").trimmed().toInt();
|
||||
m_nDateEnd = today.toString("yyyyMMdd").trimmed().toInt();
|
||||
m_bDateAll = false;
|
||||
}
|
||||
else if(m_strRecentPeriod == "Months")
|
||||
{
|
||||
int nDate = m_mapParam.value("RecentDate").trimmed().toInt();
|
||||
QDateTime today = QDateTime::currentDateTime();
|
||||
QDateTime startday = today.addMonths(-(nDate));
|
||||
startday = startday.addDays(1);
|
||||
m_nDateStart = startday.toString("yyyyMMdd").trimmed().toInt();
|
||||
m_nDateEnd = today.toString("yyyyMMdd").trimmed().toInt();
|
||||
m_bDateAll = false;
|
||||
}
|
||||
else if(m_strRecentPeriod == "Years")
|
||||
{
|
||||
int nDate = m_mapParam.value("RecentDate").trimmed().toInt();
|
||||
QDateTime today = QDateTime::currentDateTime();
|
||||
QDateTime startday = today.addYears(-(nDate));
|
||||
startday = startday.addDays(1);
|
||||
m_nDateStart = startday.toString("yyyyMMdd").trimmed().toInt();
|
||||
m_nDateEnd = today.toString("yyyyMMdd").trimmed().toInt();
|
||||
m_bDateAll = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void YPlatformOneMThread::run()
|
||||
{
|
||||
typedef mecab_t* (*mecab_new_fun)(int,char**);
|
||||
typedef const char* (*mecab_sparse_tostr_fun)(mecab_t *mecab, const char *str);
|
||||
typedef void (*mecab_destroy_fun)(mecab_t *mecab);
|
||||
|
||||
mecab_t *mecab;
|
||||
mecab_new_fun mecab_new = (mecab_new_fun)QLibrary::resolve("libmecab.dll","mecab_new");
|
||||
mecab_sparse_tostr_fun mecab_sparse_tostr = (mecab_sparse_tostr_fun)QLibrary::resolve("libmecab.dll","mecab_sparse_tostr");
|
||||
|
||||
parseParam();
|
||||
|
||||
if(userdict.length() < 1)
|
||||
{
|
||||
/*
|
||||
char *t[] = {"RRR","-d","dic"};
|
||||
int int_t = 3;
|
||||
*/
|
||||
|
||||
char a[] = "RRR";
|
||||
char b[] = "-d";
|
||||
char c[] = "dic";
|
||||
char *t[3];
|
||||
t[0] = a;
|
||||
t[1] = b;
|
||||
t[2] = c;
|
||||
int int_t = 3;
|
||||
|
||||
mecab = mecab_new(int_t, t);
|
||||
}
|
||||
else
|
||||
{
|
||||
char *cstr = new char[userdict.toStdString().length() + 1];
|
||||
strcpy(cstr, userdict.toStdString().c_str());
|
||||
/*
|
||||
char **t = {"RRR","-d","dic","-u",cstr};
|
||||
int int_t = 5;
|
||||
*/
|
||||
char a[] = "RRR";
|
||||
char b[] = "-d";
|
||||
char c[] = "dic";
|
||||
char d[] = "-u";
|
||||
|
||||
char *t[5];
|
||||
t[0] = a;
|
||||
t[1] = b;
|
||||
t[2] = c;
|
||||
t[3] = d;
|
||||
t[4] = cstr;
|
||||
int int_t = 5;
|
||||
|
||||
mecab = mecab_new(int_t, t);
|
||||
delete[] cstr;
|
||||
}
|
||||
mecab_destroy_fun mecab_destroy = (mecab_destroy_fun)QLibrary::resolve("libmecab.dll","mecab_destroy");
|
||||
|
||||
|
||||
|
||||
//qDebug() << num;
|
||||
|
||||
int nDate = 0;
|
||||
while(true)
|
||||
{
|
||||
QString strTitle;
|
||||
QString strBody;
|
||||
QString strDate;
|
||||
QString strData;
|
||||
QString strPlatformTitle;
|
||||
QString strArticle;
|
||||
QString strPlatformName;
|
||||
QString strPlatformForm;
|
||||
{
|
||||
mutex->lock();
|
||||
if(!m_pDAInterface->hasNext())
|
||||
{
|
||||
mutex->unlock();
|
||||
break;
|
||||
}
|
||||
strTitle = m_pDAInterface->getArticleTitle();
|
||||
strDate = m_pDAInterface->getArticleDate();
|
||||
strPlatformTitle = m_pDAInterface->getPlatformTitle();
|
||||
strBody = m_pDAInterface->getArticleData();
|
||||
strArticle = m_pDAInterface->getArticleForm();
|
||||
strPlatformName = m_pDAInterface->getPlatformName().trimmed();
|
||||
strPlatformForm = m_pDAInterface->getPlatformForm().trimmed();
|
||||
|
||||
m_pDAInterface->next();
|
||||
mutex->unlock();
|
||||
}
|
||||
|
||||
|
||||
bool bContinue = true;
|
||||
{
|
||||
switch(m_nArticle)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(strArticle.trimmed().compare("reply", Qt::CaseInsensitive) == 0)
|
||||
bContinue = false;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
if(strArticle.trimmed().compare("body", Qt::CaseInsensitive) == 0)
|
||||
bContinue = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!bContinue)
|
||||
continue;
|
||||
|
||||
if(strPlatformForm.trimmed().isEmpty())
|
||||
continue;
|
||||
|
||||
if(strPlatformName.trimmed().isEmpty())
|
||||
continue;
|
||||
|
||||
|
||||
{
|
||||
switch(m_nTitleBody)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
strData = strTitle;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
strData = strBody;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
strData = strTitle + "\n" + strBody;
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
strData = strPlatformTitle;
|
||||
break;
|
||||
}
|
||||
strTitle.clear();
|
||||
strBody.clear();
|
||||
strPlatformTitle.clear();
|
||||
}
|
||||
|
||||
//if(!strData.contains(m_strCKeyword, Qt::CaseInsensitive))
|
||||
if(!strData.contains(m_strCKeyword, Qt::CaseInsensitive))
|
||||
continue;
|
||||
|
||||
if(strDate.length() < 11)
|
||||
continue;
|
||||
|
||||
strDate = strDate.left(11);
|
||||
if(strDate.trimmed().length()<10)
|
||||
{
|
||||
nDate = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
strDate = strDate.replace("-","").trimmed();
|
||||
if(strDate.length() < 8)
|
||||
{
|
||||
nDate = 0;
|
||||
}
|
||||
else
|
||||
nDate = strDate.toInt();
|
||||
}
|
||||
|
||||
if(!m_bDateAll)
|
||||
{
|
||||
if(nDate < m_nDateStart || m_nDateEnd < nDate)
|
||||
continue;
|
||||
}
|
||||
|
||||
QString m_strDate;
|
||||
QString m_strKeyword;
|
||||
QString m_strMorphere;
|
||||
|
||||
switch(m_nPeriod)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_strDate = "ALL";
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
m_strDate = "D" + QString::number(nDate);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
/*
|
||||
QDate tempdate = QDate(nDate/10000, (nDate%10000)/100, nDate%100);
|
||||
mapkey.strDate = "W" + QString::number(nDate/10000);
|
||||
if(tempdate.weekNumber() < 10)
|
||||
mapkey.strDate += "0";
|
||||
mapkey.strDate += QString::number(tempdate.weekNumber());
|
||||
*/
|
||||
m_strDate = getWeeksInMonth(nDate);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
m_strDate = "M";
|
||||
if((nDate/100) < 10)
|
||||
m_strDate += "0";
|
||||
m_strDate += QString::number(nDate/100);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
QString strAnalyzedLine = QString::fromStdString(mecab_sparse_tostr(mecab, strData.toStdString().c_str())) + "\n";
|
||||
QStringList strListAll = strAnalyzedLine.split("\n",QString::SkipEmptyParts);
|
||||
QMap<QString, int> mapResult;
|
||||
|
||||
foreach(QString strLine, strListAll)
|
||||
{
|
||||
QStringList strListLine = strLine.split("\t");
|
||||
if(strListLine.size() < 2)
|
||||
continue;
|
||||
QStringList strpumsa = strListLine.at(1).trimmed().split(",");
|
||||
foreach(QString strMorphere, m_slMorphereList)
|
||||
{
|
||||
if(strpumsa.at(0).trimmed().contains(strMorphere,Qt::CaseInsensitive))
|
||||
{
|
||||
m_strKeyword = strListLine.at(0).toLower();
|
||||
m_strMorphere = strMorphere;
|
||||
QString strkey = m_strDate + "~!@" + strPlatformName + "~!@" + strPlatformForm + "~!@" + m_strMorphere + "~!@" + m_strKeyword;
|
||||
if(mapResult.contains(strkey))
|
||||
{
|
||||
(mapResult)[strkey]++;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
mapResult.insert(strkey,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!m_bDuplicate)
|
||||
{
|
||||
for(QMap<QString, int>::iterator iterPos = mapResult.begin(); iterPos != mapResult.end(); iterPos++)
|
||||
{
|
||||
mapResult[iterPos.key()] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
for(QMap<QString, int>::iterator iterPos = mapResult.begin(); iterPos != mapResult.end(); iterPos++)
|
||||
{
|
||||
if(m_mapResult.contains(iterPos.key()))
|
||||
{
|
||||
m_mapResult[iterPos.key()] += iterPos.value();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_mapResult.insert(iterPos.key(), iterPos.value());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//if(m_bDateAll)
|
||||
|
||||
//qDebug() << num << " : " << strData;
|
||||
}
|
||||
|
||||
mecab_destroy(mecab);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void YPlatformMThread::parseParam()
|
||||
{
|
||||
userdict = m_mapParam.value("UserDict");
|
||||
|
||||
m_nArticle = m_mapParam.value("Article").toInt();
|
||||
|
||||
m_nTitleBody = m_mapParam.value("TitleBody").toInt();
|
||||
m_nPeriod = m_mapParam.value("Period").toInt();
|
||||
|
||||
m_nDateStart = m_mapParam.value("DateStart").toInt();
|
||||
m_nDateEnd = m_mapParam.value("DateEnd").toInt();
|
||||
|
||||
m_bDateAll = true;
|
||||
|
||||
if(m_mapParam.value("DateALL") == "true")
|
||||
m_bDateAll = true;
|
||||
else
|
||||
m_bDateAll = false;
|
||||
|
||||
m_slMorphereList = m_mapParam.value("MorphereList").split(" ");
|
||||
|
||||
m_strCKeyword = m_mapParam.value("CenterKeyword").trimmed();
|
||||
|
||||
m_slOneDepthKeys = m_mapParam.value("OneDepthKeys").split(" ");
|
||||
if(m_mapParam.value("CountMethod") == "Duplicate")
|
||||
m_bDuplicate = true;
|
||||
else
|
||||
m_bDuplicate = false;
|
||||
|
||||
|
||||
m_strRecentPeriod = m_mapParam.value("RecentPeriod").trimmed();
|
||||
|
||||
if(m_strRecentPeriod == "None")
|
||||
{
|
||||
|
||||
}
|
||||
else if(m_strRecentPeriod == "Days")
|
||||
{
|
||||
int nDate = m_mapParam.value("RecentDate").trimmed().toInt();
|
||||
QDateTime today = QDateTime::currentDateTime();
|
||||
QDateTime startday = today.addDays(-(nDate));
|
||||
startday = startday.addDays(1);
|
||||
m_nDateStart = startday.toString("yyyyMMdd").trimmed().toInt();
|
||||
m_nDateEnd = today.toString("yyyyMMdd").trimmed().toInt();
|
||||
m_bDateAll = false;
|
||||
}
|
||||
else if(m_strRecentPeriod == "Weeks")
|
||||
{
|
||||
int nDate = m_mapParam.value("RecentDate").trimmed().toInt();
|
||||
QDateTime today = QDateTime::currentDateTime();
|
||||
QDateTime startday = today.addDays(-(nDate*7));
|
||||
startday = startday.addDays(1);
|
||||
m_nDateStart = startday.toString("yyyyMMdd").trimmed().toInt();
|
||||
m_nDateEnd = today.toString("yyyyMMdd").trimmed().toInt();
|
||||
m_bDateAll = false;
|
||||
}
|
||||
else if(m_strRecentPeriod == "Months")
|
||||
{
|
||||
int nDate = m_mapParam.value("RecentDate").trimmed().toInt();
|
||||
QDateTime today = QDateTime::currentDateTime();
|
||||
QDateTime startday = today.addMonths(-(nDate));
|
||||
startday = startday.addDays(1);
|
||||
m_nDateStart = startday.toString("yyyyMMdd").trimmed().toInt();
|
||||
m_nDateEnd = today.toString("yyyyMMdd").trimmed().toInt();
|
||||
m_bDateAll = false;
|
||||
}
|
||||
else if(m_strRecentPeriod == "Years")
|
||||
{
|
||||
int nDate = m_mapParam.value("RecentDate").trimmed().toInt();
|
||||
QDateTime today = QDateTime::currentDateTime();
|
||||
QDateTime startday = today.addYears(-(nDate));
|
||||
startday = startday.addDays(1);
|
||||
m_nDateStart = startday.toString("yyyyMMdd").trimmed().toInt();
|
||||
m_nDateEnd = today.toString("yyyyMMdd").trimmed().toInt();
|
||||
m_bDateAll = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void YPlatformMThread::run()
|
||||
{
|
||||
typedef mecab_t* (*mecab_new_fun)(int,char**);
|
||||
typedef const char* (*mecab_sparse_tostr_fun)(mecab_t *mecab, const char *str);
|
||||
typedef void (*mecab_destroy_fun)(mecab_t *mecab);
|
||||
|
||||
mecab_t *mecab;
|
||||
mecab_new_fun mecab_new = (mecab_new_fun)QLibrary::resolve("libmecab.dll","mecab_new");
|
||||
mecab_sparse_tostr_fun mecab_sparse_tostr = (mecab_sparse_tostr_fun)QLibrary::resolve("libmecab.dll","mecab_sparse_tostr");
|
||||
|
||||
parseParam();
|
||||
|
||||
if(userdict.length() < 1)
|
||||
{
|
||||
/*
|
||||
char *t[] = {"RRR","-d","dic"};
|
||||
int int_t = 3;
|
||||
*/
|
||||
|
||||
char a[] = "RRR";
|
||||
char b[] = "-d";
|
||||
char c[] = "dic";
|
||||
char *t[3];
|
||||
t[0] = a;
|
||||
t[1] = b;
|
||||
t[2] = c;
|
||||
int int_t = 3;
|
||||
|
||||
mecab = mecab_new(int_t, t);
|
||||
}
|
||||
else
|
||||
{
|
||||
char *cstr = new char[userdict.toStdString().length() + 1];
|
||||
strcpy(cstr, userdict.toStdString().c_str());
|
||||
/*
|
||||
char **t = {"RRR","-d","dic","-u",cstr};
|
||||
int int_t = 5;
|
||||
*/
|
||||
char a[] = "RRR";
|
||||
char b[] = "-d";
|
||||
char c[] = "dic";
|
||||
char d[] = "-u";
|
||||
|
||||
char *t[5];
|
||||
t[0] = a;
|
||||
t[1] = b;
|
||||
t[2] = c;
|
||||
t[3] = d;
|
||||
t[4] = cstr;
|
||||
int int_t = 5;
|
||||
|
||||
mecab = mecab_new(int_t, t);
|
||||
delete[] cstr;
|
||||
}
|
||||
mecab_destroy_fun mecab_destroy = (mecab_destroy_fun)QLibrary::resolve("libmecab.dll","mecab_destroy");
|
||||
|
||||
|
||||
|
||||
//qDebug() << num;
|
||||
|
||||
int nDate = 0;
|
||||
while(true)
|
||||
{
|
||||
QString strTitle;
|
||||
QString strBody;
|
||||
QString strDate;
|
||||
QString strData;
|
||||
QString strPlatformTitle;
|
||||
QString strArticle;
|
||||
QString strPlatformName;
|
||||
QString strPlatformForm;
|
||||
{
|
||||
mutex->lock();
|
||||
if(!m_pDAInterface->hasNext())
|
||||
{
|
||||
mutex->unlock();
|
||||
break;
|
||||
}
|
||||
strTitle = m_pDAInterface->getArticleTitle();
|
||||
strDate = m_pDAInterface->getArticleDate();
|
||||
strPlatformTitle = m_pDAInterface->getPlatformTitle();
|
||||
strBody = m_pDAInterface->getArticleData();
|
||||
strArticle = m_pDAInterface->getArticleForm();
|
||||
strPlatformName = m_pDAInterface->getPlatformName().trimmed();
|
||||
strPlatformForm = m_pDAInterface->getPlatformForm().trimmed();
|
||||
|
||||
m_pDAInterface->next();
|
||||
mutex->unlock();
|
||||
}
|
||||
|
||||
bool bContinue = true;
|
||||
{
|
||||
switch(m_nArticle)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(strArticle.trimmed().compare("reply", Qt::CaseInsensitive) == 0)
|
||||
bContinue = false;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
if(strArticle.trimmed().compare("body", Qt::CaseInsensitive) == 0)
|
||||
bContinue = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!bContinue)
|
||||
continue;
|
||||
|
||||
|
||||
if(strPlatformForm.trimmed().isEmpty())
|
||||
continue;
|
||||
|
||||
if(strPlatformName.trimmed().isEmpty())
|
||||
continue;
|
||||
|
||||
|
||||
|
||||
|
||||
{
|
||||
switch(m_nTitleBody)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
strData = strTitle;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
strData = strBody;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
strData = strTitle + "\n" + strBody;
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
strData = strPlatformTitle;
|
||||
break;
|
||||
}
|
||||
strTitle.clear();
|
||||
strBody.clear();
|
||||
strPlatformTitle.clear();
|
||||
}
|
||||
|
||||
//if(!strData.contains(m_strCKeyword, Qt::CaseInsensitive))
|
||||
if(!strData.contains(m_strCKeyword, Qt::CaseInsensitive))
|
||||
continue;
|
||||
|
||||
if(strDate.length() < 11)
|
||||
continue;
|
||||
|
||||
strDate = strDate.left(11);
|
||||
if(strDate.trimmed().length()<10)
|
||||
{
|
||||
nDate = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
strDate = strDate.replace("-","").trimmed();
|
||||
if(strDate.length() < 8)
|
||||
{
|
||||
nDate = 0;
|
||||
}
|
||||
else
|
||||
nDate = strDate.toInt();
|
||||
}
|
||||
|
||||
if(!m_bDateAll)
|
||||
{
|
||||
if(nDate < m_nDateStart || m_nDateEnd < nDate)
|
||||
continue;
|
||||
}
|
||||
|
||||
QString m_strDate;
|
||||
QString m_strKeyword;
|
||||
QString m_strMorphere;
|
||||
|
||||
switch(m_nPeriod)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_strDate = "ALL";
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
m_strDate = "D" + QString::number(nDate);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
/*
|
||||
QDate tempdate = QDate(nDate/10000, (nDate%10000)/100, nDate%100);
|
||||
mapkey.strDate = "W" + QString::number(nDate/10000);
|
||||
if(tempdate.weekNumber() < 10)
|
||||
mapkey.strDate += "0";
|
||||
mapkey.strDate += QString::number(tempdate.weekNumber());
|
||||
*/
|
||||
m_strDate = getWeeksInMonth(nDate);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
m_strDate = "M";
|
||||
if((nDate/100) < 10)
|
||||
m_strDate += "0";
|
||||
m_strDate += QString::number(nDate/100);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
QString strAnalyzedLine = QString::fromStdString(mecab_sparse_tostr(mecab, strData.toStdString().c_str())) + "\n";
|
||||
QStringList strListAll = strAnalyzedLine.split("\n",QString::SkipEmptyParts);
|
||||
|
||||
QMap<QString, int> mapResult;
|
||||
|
||||
foreach(QString strLine, strListAll)
|
||||
{
|
||||
QStringList strListLine = strLine.split("\t");
|
||||
if(strListLine.size() < 2)
|
||||
continue;
|
||||
QStringList strpumsa = strListLine.at(1).trimmed().split(",");
|
||||
foreach(QString strMorphere, m_slMorphereList)
|
||||
{
|
||||
if(strpumsa.at(0).trimmed().contains(strMorphere,Qt::CaseInsensitive))
|
||||
{
|
||||
m_strKeyword = strListLine.at(0).toLower();
|
||||
m_strMorphere = strMorphere;
|
||||
QString strkey = m_strDate + "~!@" + strPlatformName + "~!@" + strPlatformForm + "~!@" + m_strMorphere + "~!@" + m_strKeyword;
|
||||
if(mapResult.contains(strkey))
|
||||
{
|
||||
(mapResult)[strkey]++;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
mapResult.insert(strkey,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!m_bDuplicate)
|
||||
{
|
||||
for(QMap<QString, int>::iterator iterPos = mapResult.begin(); iterPos != mapResult.end(); iterPos++)
|
||||
{
|
||||
mapResult[iterPos.key()] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach(QString str, m_slOneDepthKeys)
|
||||
{
|
||||
//qDebug() << "str :" << str;
|
||||
if(mapResult.contains(str))
|
||||
{
|
||||
for(QMap<QString, int>::iterator iterPos = mapResult.begin(); iterPos != mapResult.end(); iterPos++)
|
||||
{
|
||||
if(iterPos.key() == str)
|
||||
continue;
|
||||
QString key = iterPos.key();
|
||||
QStringList slkey = key.split("~!@", QString::SkipEmptyParts);
|
||||
int nLength = slkey.length();
|
||||
QString strkey = str + "~!@" + slkey.at(nLength - 2) + "~!@" + slkey.at(nLength - 1);
|
||||
if(m_mapResult.contains(strkey))
|
||||
{
|
||||
m_mapResult[strkey] += iterPos.value();
|
||||
//qDebug() << strkey;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_mapResult.insert(strkey, iterPos.value());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mecab_destroy(mecab);
|
||||
}
|
||||
|
||||
@@ -90,12 +90,55 @@ public:
|
||||
class YPlatformMThread:public YMorphereThread
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
QString userdict;
|
||||
int m_nTitleBody;
|
||||
int m_nPeriod;
|
||||
unsigned int m_nDateStart;
|
||||
unsigned int m_nDateEnd;
|
||||
bool m_bDateAll;
|
||||
QStringList m_slMorphereList;
|
||||
QString m_strCKeyword;
|
||||
QStringList m_slOneDepthKeys;
|
||||
bool m_bDuplicate;
|
||||
QString m_strRecentPeriod;
|
||||
int m_nArticle;
|
||||
|
||||
protected:
|
||||
void run();
|
||||
public:
|
||||
void parseParam();
|
||||
};
|
||||
|
||||
|
||||
class YPlatformOneMThread:public YMorphereThread
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
//QString getWeeksInMonth(unsigned int _nDate);
|
||||
|
||||
|
||||
|
||||
QString userdict;
|
||||
int m_nTitleBody;
|
||||
int m_nPeriod;
|
||||
unsigned int m_nDateStart;
|
||||
unsigned int m_nDateEnd;
|
||||
bool m_bDateAll;
|
||||
QStringList m_slMorphereList;
|
||||
QString m_strCKeyword;
|
||||
bool m_bDuplicate;
|
||||
QString m_strRecentPeriod;
|
||||
int m_nArticle;
|
||||
protected:
|
||||
void run();
|
||||
public:
|
||||
void parseParam();
|
||||
};
|
||||
|
||||
|
||||
|
||||
class YIDMThread:public YMorphereThread
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -31,6 +31,8 @@ YMBasicWidget::YMBasicWidget(QWidget *parent)
|
||||
m_strlistMorphereko << "NNG" <<"NNP"<<"NNB"<<"NNBC"<<"NR"<<"NP"<<"VV"<<"VA"<<"VX"<<"VCP"<<"VCN"<<"MM"<<"MAG"<<"MAJ"<<"IC"<<"JKS"<<"JKC"<<"JKG"<<"JKO"<<"JKB"<<"JKV"<<"JKQ"<<"JX"<<"JC"<<"EP"<<"EF"<<"EC"<<"ETN"<<"ETM"<<"XPN"<<"XSN"<<"XSV"<<"XSA"<<"XR"<<"SF"<<"SE"<<"SSO"<<"SSC"<<"SC"<<"SY"<<"SL"<<"SH"<<"SN";
|
||||
}
|
||||
|
||||
m_strName = "basic";
|
||||
|
||||
QVBoxLayout *vMainLayout = new QVBoxLayout;
|
||||
vMainLayout->setAlignment(Qt::AlignVCenter);
|
||||
QVBoxLayout *vboxlayout = new QVBoxLayout;
|
||||
@@ -709,6 +711,118 @@ void YMBasicWidget::clearView()
|
||||
m_mapViewResult.clear();
|
||||
}
|
||||
|
||||
void YMBasicWidget::setParam(QString strJson)
|
||||
{
|
||||
|
||||
SJson json;
|
||||
{
|
||||
|
||||
QString strMorphere = json.Get(strJson, "MorphereList");
|
||||
QStringList slMorphere = strMorphere.split(" ", QString::SkipEmptyParts);
|
||||
|
||||
for(int i = 0; i < m_plwMorphereAdd->count(); i++)
|
||||
{
|
||||
m_plwMorphereAdd->item(i)->setHidden(true);
|
||||
}
|
||||
|
||||
for(int i = 0; i < m_plwMorphereAdd->count(); i++)
|
||||
{
|
||||
foreach(QString morphere, slMorphere)
|
||||
{
|
||||
if(m_plwMorphereAdd->item(i)->data(Qt::UserRole).toString().compare(morphere, Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
m_plwMorphereAdd->item(i)->setHidden(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
int nThread = json.Get(strJson, "Thread").toInt();
|
||||
for(int i = 0; i < m_pcbThread->count(); i++)
|
||||
{
|
||||
//qDebug() << m_pcbThread->itemData(i).toInt();
|
||||
if(m_pcbThread->itemText(i).trimmed().toInt() == nThread)
|
||||
{
|
||||
m_pcbThread->setCurrentIndex(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
QString strCountMethod = json.Get(strJson, "CountMethod").trimmed();
|
||||
for(int i = 0; i < m_pcbCountMethod->count(); i++)
|
||||
{
|
||||
//qDebug() << m_pcbThread->itemData(i).toInt();
|
||||
if(m_pcbCountMethod->itemText(i).trimmed().compare(strCountMethod) == 0)
|
||||
{
|
||||
m_pcbCountMethod->setCurrentIndex(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
QString strRecentPeriod = json.Get(strJson, "RecentPeriod").trimmed();
|
||||
for(int i = 0; i < m_pcbDuring->count(); i++)
|
||||
{
|
||||
//qDebug() << m_pcbThread->itemData(i).toInt();
|
||||
if(m_pcbDuring->itemText(i).trimmed().compare(strRecentPeriod) == 0)
|
||||
{
|
||||
m_pcbDuring->setCurrentIndex(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
int nPeriod = json.Get(strJson, "Period").toInt();
|
||||
m_pcbPeriod->setCurrentIndex(nPeriod);
|
||||
}
|
||||
{
|
||||
int nBodyTitle = json.Get(strJson, "TitleBody").toInt();
|
||||
m_pcbData->setCurrentIndex(nBodyTitle);
|
||||
}
|
||||
{
|
||||
QString strDateAll = json.Get(strJson, "DateALL").trimmed();
|
||||
if(strDateAll.compare("true",Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
m_pcbDate->setCurrentIndex(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcbDate->setCurrentIndex(1);
|
||||
}
|
||||
}
|
||||
{
|
||||
QString strRecentDate = json.Get(strJson, "RecentDate");
|
||||
m_pleDates->setText(strRecentDate);
|
||||
}
|
||||
{
|
||||
|
||||
m_pdeStart->setDate(QDate::fromString(json.Get(strJson,"DateStart"),"yyyyMMdd"));
|
||||
m_pdeEnd->setDate(QDate::fromString(json.Get(strJson,"DateEnd"),"yyyyMMdd"));
|
||||
}
|
||||
{
|
||||
QString userdict = json.Get(strJson, "UserDict");
|
||||
if(!userdict.isEmpty())
|
||||
{
|
||||
|
||||
m_pcbDictionary->clear();
|
||||
QStringList sluserdict = userdict.split(",");
|
||||
foreach(QString dict, sluserdict)
|
||||
{
|
||||
m_pcbDictionary->addItem(dict);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcbDictionary->clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void YMBasicWidget::SortViewResult()
|
||||
{
|
||||
|
||||
@@ -782,7 +896,6 @@ void YMBasicWidget::SortViewResult()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void YMBasicWidget::ViewResult()
|
||||
{
|
||||
SortViewResult();
|
||||
|
||||
@@ -40,6 +40,8 @@ public:
|
||||
QString getUserDictList();
|
||||
void SaveFile();
|
||||
void SaveFileSimple();
|
||||
void setParam(QString strJson);
|
||||
|
||||
|
||||
private:
|
||||
// Data
|
||||
|
||||
@@ -16,10 +16,14 @@ YMFilterFactory::~YMFilterFactory()
|
||||
|
||||
YMFilter* YMFilterFactory::getFilter(QMap<QString, QString> mapParam)
|
||||
{
|
||||
if(mapParam.value("Algorithm").trimmed() == "onedepth")
|
||||
if(mapParam.value("Algorithm").trimmed().compare("onedepth", Qt::CaseInsensitive) == 0)
|
||||
return new YMOneDepthFilter();
|
||||
else if(mapParam.value("Algorithm").trimmed() == "twodepth")
|
||||
else if(mapParam.value("Algorithm").trimmed().compare("twodepth", Qt::CaseInsensitive) == 0)
|
||||
return new YMTwoDepthFilter();
|
||||
else if(mapParam.value("Algorithm").trimmed().compare("platformone", Qt::CaseInsensitive) == 0)
|
||||
return new YMPlatformOneFilter();
|
||||
else if(mapParam.value("Algorithm").trimmed().compare("platform", Qt::CaseInsensitive) == 0)
|
||||
return new YMPlatformFilter();
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
@@ -377,6 +381,468 @@ QMap<QString, int> YMTwoDepthFilter::RankFilterALL(QMap<QString, int> mapResult)
|
||||
}
|
||||
|
||||
|
||||
//qDebug() << slkey.at(0);
|
||||
if(Result.contains(key))
|
||||
{
|
||||
Result[key].insertMulti(iterPos.value(), iterPos.key());
|
||||
}
|
||||
else
|
||||
{
|
||||
QMap<int, QString> qLast;
|
||||
qLast.insert(iterPos.value(), iterPos.key());
|
||||
Result.insert(key, qLast);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int nRank = m_mapParam.value("RankFilterAll2").toInt();
|
||||
|
||||
qDebug() << "TwoDepth nRank: " << nRank;
|
||||
|
||||
QMap <QString, int> totalResult;
|
||||
//qDebug() << "rankfilter:" << nRank;
|
||||
for(QMap<QString, QMap<int, QString> >::iterator iterPos = Result.begin(); iterPos != Result.end(); iterPos++)
|
||||
{
|
||||
QMapIterator <int, QString> iter(Result[iterPos.key()]);
|
||||
iter.toBack();
|
||||
int i = 0;
|
||||
while(iter.hasPrevious())
|
||||
{
|
||||
if(i >= nRank)
|
||||
break;
|
||||
|
||||
iter.previous();
|
||||
totalResult.insertMulti(iter.value(), iter.key());
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
return totalResult;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* class YMPlatformOneFilter
|
||||
*/
|
||||
|
||||
|
||||
|
||||
YMPlatformOneFilter::YMPlatformOneFilter()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
YMPlatformOneFilter::~YMPlatformOneFilter()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QMap<QString, int> YMPlatformOneFilter::Extractor(QMap<QString, int> mapResult)
|
||||
{
|
||||
QMap<QString, int> totalResult;
|
||||
QStringList slExtractor;
|
||||
QRegExp rx("[\\s,.;]");
|
||||
slExtractor = m_mapParam.value("Extractor").split(rx);
|
||||
|
||||
for(QMap<QString, int>::iterator iterPos = mapResult.begin(); iterPos != mapResult.end(); iterPos++)
|
||||
{
|
||||
QString strkey = iterPos.key();
|
||||
QStringList slkey = strkey.split("~!@", QString::SkipEmptyParts);
|
||||
int nLastIndex = slkey.length() - 1;
|
||||
|
||||
foreach(QString str, slExtractor)
|
||||
{
|
||||
if(slkey.at(nLastIndex).compare(str.trimmed(), Qt::CaseInsensitive) == 0)
|
||||
totalResult.insert(iterPos.key(), iterPos.value());
|
||||
}
|
||||
}
|
||||
return totalResult;
|
||||
}
|
||||
|
||||
QMap<QString, int> YMPlatformOneFilter::KeywordLengthFilter(QMap<QString, int> mapResult)
|
||||
{
|
||||
QMap<QString, int> totalResult;
|
||||
|
||||
int nLength = m_mapParam.value("KeywordLengthFilter").toInt();
|
||||
|
||||
for(QMap<QString, int>::iterator iterPos = mapResult.begin(); iterPos != mapResult.end(); iterPos++)
|
||||
{
|
||||
QString strkey = iterPos.key();
|
||||
QStringList slkey = strkey.split("~!@", QString::SkipEmptyParts);
|
||||
int nLastIndex = slkey.length() - 1;
|
||||
|
||||
if(slkey.at(nLastIndex).trimmed().length() >= nLength)
|
||||
{
|
||||
totalResult.insert(iterPos.key(), iterPos.value());
|
||||
//qDebug() << iterPos.key() << " :" << iterPos.value();
|
||||
}
|
||||
|
||||
}
|
||||
return totalResult;
|
||||
}
|
||||
|
||||
QMap<QString, int> YMPlatformOneFilter::KeywordFilter(QMap<QString, int> mapResult)
|
||||
{
|
||||
QMap<QString, int> totalResult;
|
||||
QRegExp rx("[\\s,;]");
|
||||
QStringList slKeywordFilter = m_mapParam.value("KeywordFilter").split(rx);
|
||||
|
||||
for(QMap<QString, int>::iterator iterPos = mapResult.begin(); iterPos != mapResult.end(); iterPos++)
|
||||
{
|
||||
QString strkey = iterPos.key();
|
||||
QStringList slkey = strkey.split("~!@", QString::SkipEmptyParts);
|
||||
int nLastIndex = slkey.length() - 1;
|
||||
//qDebug() << "nLastIndex: " << nLastIndex;
|
||||
bool bChecked = true;
|
||||
foreach(QString str, slKeywordFilter)
|
||||
{
|
||||
if(slkey.at(nLastIndex).compare(str.trimmed(), Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
bChecked = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(bChecked)
|
||||
totalResult.insert(iterPos.key(), iterPos.value());
|
||||
}
|
||||
|
||||
return totalResult;
|
||||
}
|
||||
|
||||
|
||||
QMap<QString, int> YMPlatformOneFilter::RankFilterSeparated(QMap<QString, int> mapResult)
|
||||
{
|
||||
QMap<QString, QMap<QString, QMap<int, QString> > > m_mapViewResult;
|
||||
int nRank = m_mapParam.value("RankFilterSeparated").toInt();
|
||||
|
||||
//qDebug() << "nRank" <<nRank;
|
||||
|
||||
for(QMap<QString, int>::iterator iterPos = mapResult.begin(); iterPos != mapResult.end(); iterPos++)
|
||||
{
|
||||
QString strkey = iterPos.key();
|
||||
int count = iterPos.value();
|
||||
QStringList strlistKey = strkey.split("~!@");
|
||||
QString strDate = strlistKey.at(0);
|
||||
QString strMorphere = strlistKey.at(1);
|
||||
QString strKeyword = strlistKey.at(2);
|
||||
|
||||
if(m_mapViewResult.contains(strDate))
|
||||
{
|
||||
if(m_mapViewResult.value(strDate).contains(strMorphere))
|
||||
{
|
||||
m_mapViewResult[(strDate)][(strMorphere)].insertMulti(count, strKeyword);
|
||||
}
|
||||
else
|
||||
{
|
||||
QMap<int, QString> qLast;
|
||||
qLast.insert(count, strKeyword);
|
||||
m_mapViewResult[(strDate)].insert(strMorphere, qLast);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QMap<int, QString> qLast;
|
||||
qLast.insert(count , strKeyword);
|
||||
QMap<QString, QMap<int, QString> > qMedium;
|
||||
qMedium.insert(strMorphere, qLast);
|
||||
m_mapViewResult.insert(strDate, qMedium);
|
||||
}
|
||||
}
|
||||
QMap<QString, int> totalResult;
|
||||
|
||||
for(QMap<QString, QMap<QString, QMap<int, QString> > >::iterator iterPos1 = m_mapViewResult.begin(); iterPos1 != m_mapViewResult.end(); iterPos1++)
|
||||
{
|
||||
for(QMap<QString, QMap<int, QString> >::iterator iterPos2 = iterPos1.value().begin(); iterPos2 != iterPos1.value().end(); iterPos2++)
|
||||
{
|
||||
int i = 0;
|
||||
QMapIterator<int, QString> iter(m_mapViewResult[iterPos1.key()][iterPos2.key()]);
|
||||
iter.toBack();
|
||||
while(iter.hasPrevious())
|
||||
{
|
||||
if(i >= nRank)
|
||||
break;
|
||||
iter.previous();
|
||||
QString key = iterPos1.key() + "~!@" + iterPos2.key() + "~!@" + iter.value();
|
||||
//totalResult.insert(QString(iterPos1.key() + "~!@" + iterPos2.key() + "~!@" + iter.value()), iter.key());
|
||||
totalResult.insert(key, iter.key());
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return totalResult;
|
||||
}
|
||||
|
||||
|
||||
|
||||
QMap<QString, int> YMPlatformOneFilter::RankFilterALL(QMap<QString, int> mapResult)
|
||||
{
|
||||
QMap<QString, QMap<int, QString> > Result;
|
||||
//QMap<int, QString> Result;
|
||||
|
||||
for(QMap<QString, int>::iterator iterPos = mapResult.begin(); iterPos != mapResult.end(); iterPos++)
|
||||
{
|
||||
QString strkey = iterPos.key();
|
||||
QStringList slkey = strkey.split("~!@", QString::SkipEmptyParts);
|
||||
QString key = slkey.at(0).trimmed();
|
||||
int nLength = slkey.length();
|
||||
|
||||
for(int i = 1; i < nLength - 2 ; i++)
|
||||
{
|
||||
key += "~!@";
|
||||
key += slkey.at(i).trimmed();
|
||||
}
|
||||
|
||||
|
||||
//qDebug() << slkey.at(0);
|
||||
if(Result.contains(key))
|
||||
{
|
||||
Result[key].insertMulti(iterPos.value(), iterPos.key());
|
||||
}
|
||||
else
|
||||
{
|
||||
QMap<int, QString> qLast;
|
||||
qLast.insert(iterPos.value(), iterPos.key());
|
||||
Result.insert(key, qLast);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int nRank = m_mapParam.value("RankFilterAll").toInt();
|
||||
|
||||
qDebug() << "TwoDepth nRank: " << nRank;
|
||||
|
||||
QMap <QString, int> totalResult;
|
||||
//qDebug() << "rankfilter:" << nRank;
|
||||
for(QMap<QString, QMap<int, QString> >::iterator iterPos = Result.begin(); iterPos != Result.end(); iterPos++)
|
||||
{
|
||||
QMapIterator <int, QString> iter(Result[iterPos.key()]);
|
||||
iter.toBack();
|
||||
int i = 0;
|
||||
while(iter.hasPrevious())
|
||||
{
|
||||
if(i >= nRank)
|
||||
break;
|
||||
|
||||
iter.previous();
|
||||
totalResult.insertMulti(iter.value(), iter.key());
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
return totalResult;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* class YMPlatformFilter
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
QMap<QString, int> YMPlatformFilter::Extractor(QMap<QString, int> mapResult)
|
||||
{
|
||||
QMap<QString, int> totalResult;
|
||||
QStringList slExtractor;
|
||||
QRegExp rx("[\\s,.;]");
|
||||
slExtractor = m_mapParam.value("Extractor2").split(rx);
|
||||
|
||||
for(QMap<QString, int>::iterator iterPos = mapResult.begin(); iterPos != mapResult.end(); iterPos++)
|
||||
{
|
||||
QString strkey = iterPos.key();
|
||||
QStringList slkey = strkey.split("~!@", QString::SkipEmptyParts);
|
||||
int nLastIndex = slkey.length() - 1;
|
||||
|
||||
foreach(QString str, slExtractor)
|
||||
{
|
||||
if(slkey.at(nLastIndex).compare(str.trimmed(), Qt::CaseInsensitive) == 0)
|
||||
totalResult.insert(iterPos.key(), iterPos.value());
|
||||
}
|
||||
}
|
||||
return totalResult;
|
||||
}
|
||||
|
||||
QMap<QString, int> YMPlatformFilter::KeywordLengthFilter(QMap<QString, int> mapResult)
|
||||
{
|
||||
QMap<QString, int> totalResult;
|
||||
|
||||
int nLength = m_mapParam.value("KeywordLengthFilter2").toInt();
|
||||
|
||||
for(QMap<QString, int>::iterator iterPos = mapResult.begin(); iterPos != mapResult.end(); iterPos++)
|
||||
{
|
||||
QString strkey = iterPos.key();
|
||||
QStringList slkey = strkey.split("~!@", QString::SkipEmptyParts);
|
||||
int nLastIndex = slkey.length() - 1;
|
||||
|
||||
if(slkey.at(nLastIndex).trimmed().length() >= nLength)
|
||||
{
|
||||
totalResult.insert(iterPos.key(), iterPos.value());
|
||||
//qDebug() << iterPos.key() << " :" << iterPos.value();
|
||||
}
|
||||
|
||||
}
|
||||
return totalResult;
|
||||
}
|
||||
|
||||
QMap<QString, int> YMPlatformFilter::KeywordFilter(QMap<QString, int> mapResult)
|
||||
{
|
||||
QMap<QString, int> totalResult;
|
||||
QRegExp rx("[\\s,;]");
|
||||
QStringList slKeywordFilter = m_mapParam.value("KeywordFilter2").split(rx);
|
||||
|
||||
for(QMap<QString, int>::iterator iterPos = mapResult.begin(); iterPos != mapResult.end(); iterPos++)
|
||||
{
|
||||
QString strkey = iterPos.key();
|
||||
QStringList slkey = strkey.split("~!@", QString::SkipEmptyParts);
|
||||
int nLastIndex = slkey.length() - 1;
|
||||
//qDebug() << "nLastIndex: " << nLastIndex;
|
||||
bool bChecked = true;
|
||||
foreach(QString str, slKeywordFilter)
|
||||
{
|
||||
if(slkey.at(nLastIndex).compare(str.trimmed(), Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
bChecked = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(bChecked)
|
||||
totalResult.insert(iterPos.key(), iterPos.value());
|
||||
}
|
||||
|
||||
return totalResult;
|
||||
}
|
||||
|
||||
|
||||
QMap<QString, int> YMPlatformFilter::RankFilterSeparated(QMap<QString, int> mapResult)
|
||||
{
|
||||
QMap<QString, QMap<QString, QMap<int, QString> > > m_mapViewResult;
|
||||
int nRank = m_mapParam.value("RankFilterSeparated2").toInt();
|
||||
|
||||
//qDebug() << "nRank" <<nRank;
|
||||
|
||||
for(QMap<QString, int>::iterator iterPos = mapResult.begin(); iterPos != mapResult.end(); iterPos++)
|
||||
{
|
||||
QString strkey = iterPos.key();
|
||||
int count = iterPos.value();
|
||||
QStringList strlistKey = strkey.split("~!@");
|
||||
QString strDate = strlistKey.at(0);
|
||||
QString strMorphere = strlistKey.at(1);
|
||||
QString strKeyword = strlistKey.at(2);
|
||||
|
||||
if(m_mapViewResult.contains(strDate))
|
||||
{
|
||||
if(m_mapViewResult.value(strDate).contains(strMorphere))
|
||||
{
|
||||
m_mapViewResult[(strDate)][(strMorphere)].insertMulti(count, strKeyword);
|
||||
}
|
||||
else
|
||||
{
|
||||
QMap<int, QString> qLast;
|
||||
qLast.insert(count, strKeyword);
|
||||
m_mapViewResult[(strDate)].insert(strMorphere, qLast);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QMap<int, QString> qLast;
|
||||
qLast.insert(count , strKeyword);
|
||||
QMap<QString, QMap<int, QString> > qMedium;
|
||||
qMedium.insert(strMorphere, qLast);
|
||||
m_mapViewResult.insert(strDate, qMedium);
|
||||
}
|
||||
}
|
||||
QMap<QString, int> totalResult;
|
||||
|
||||
for(QMap<QString, QMap<QString, QMap<int, QString> > >::iterator iterPos1 = m_mapViewResult.begin(); iterPos1 != m_mapViewResult.end(); iterPos1++)
|
||||
{
|
||||
for(QMap<QString, QMap<int, QString> >::iterator iterPos2 = iterPos1.value().begin(); iterPos2 != iterPos1.value().end(); iterPos2++)
|
||||
{
|
||||
int i = 0;
|
||||
QMapIterator<int, QString> iter(m_mapViewResult[iterPos1.key()][iterPos2.key()]);
|
||||
iter.toBack();
|
||||
while(iter.hasPrevious())
|
||||
{
|
||||
if(i >= nRank)
|
||||
break;
|
||||
iter.previous();
|
||||
QString key = iterPos1.key() + "~!@" + iterPos2.key() + "~!@" + iter.value();
|
||||
//totalResult.insert(QString(iterPos1.key() + "~!@" + iterPos2.key() + "~!@" + iter.value()), iter.key());
|
||||
totalResult.insert(key, iter.key());
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return totalResult;
|
||||
}
|
||||
|
||||
|
||||
YMPlatformFilter::YMPlatformFilter()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
YMPlatformFilter::~YMPlatformFilter()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
QMap<QString, int> YMPlatformFilter::Exec(QMap<QString, int> mapResult)
|
||||
{
|
||||
QMap<QString, int> totalResult;
|
||||
if(!m_mapParam.value("Extractor2").isEmpty())
|
||||
{
|
||||
AppendMap(totalResult, Extractor(mapResult));
|
||||
}
|
||||
if(!m_mapParam.value("KeywordFilter2").isEmpty())
|
||||
{
|
||||
mapResult = KeywordFilter(mapResult);
|
||||
//AppendMap(totalResult, KeywordFilter(mapResult));
|
||||
}
|
||||
if(!m_mapParam.value("KeywordLengthFilter2").isEmpty())
|
||||
{
|
||||
mapResult = KeywordLengthFilter(mapResult);
|
||||
//totalResult = KeywordLengthFilter(totalResult);
|
||||
}
|
||||
AppendMap(totalResult, mapResult);
|
||||
if(!m_mapParam.value("RankFilterAll2").isEmpty())
|
||||
{
|
||||
totalResult = RankFilterALL(totalResult);
|
||||
}
|
||||
else if(!m_mapParam.value("RankFilterSeparated2").isEmpty())
|
||||
{
|
||||
totalResult = RankFilterSeparated(totalResult);
|
||||
}
|
||||
if(!m_mapParam.value("CounterFilter2").isEmpty())
|
||||
{
|
||||
totalResult = RankFilterSeparated(totalResult);
|
||||
}
|
||||
return totalResult;
|
||||
}
|
||||
|
||||
QMap<QString, int> YMPlatformFilter::RankFilterALL(QMap<QString, int> mapResult)
|
||||
{
|
||||
QMap<QString, QMap<int, QString> > Result;
|
||||
//QMap<int, QString> Result;
|
||||
|
||||
for(QMap<QString, int>::iterator iterPos = mapResult.begin(); iterPos != mapResult.end(); iterPos++)
|
||||
{
|
||||
QString strkey = iterPos.key();
|
||||
QStringList slkey = strkey.split("~!@", QString::SkipEmptyParts);
|
||||
QString key = slkey.at(0).trimmed();
|
||||
int nLength = slkey.length();
|
||||
|
||||
for(int i = 1; i < nLength - 2 ; i++)
|
||||
{
|
||||
key += "~!@";
|
||||
key += slkey.at(i).trimmed();
|
||||
}
|
||||
|
||||
|
||||
//qDebug() << slkey.at(0);
|
||||
if(Result.contains(key))
|
||||
@@ -417,3 +883,5 @@ QMap<QString, int> YMTwoDepthFilter::RankFilterALL(QMap<QString, int> mapResult)
|
||||
|
||||
return totalResult;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ protected:
|
||||
QMap<QString, int> KeywordLengthFilter(QMap<QString, int> mapResult);
|
||||
QMap<QString, int> KeywordFilter(QMap<QString, int> mapResult);
|
||||
QMap<QString, int> RankFilterSeparated(QMap<QString, int> mapResult);
|
||||
|
||||
public:
|
||||
YMOneDepthFilter();
|
||||
~YMOneDepthFilter();
|
||||
@@ -42,6 +43,37 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class YMPlatformOneFilter:public YMFilter
|
||||
{
|
||||
protected:
|
||||
QMap<QString, int> Extractor(QMap<QString, int> mapResult);
|
||||
QMap<QString, int> KeywordLengthFilter(QMap<QString, int> mapResult);
|
||||
QMap<QString, int> KeywordFilter(QMap<QString, int> mapResult);
|
||||
QMap<QString, int> RankFilterSeparated(QMap<QString, int> mapResult);
|
||||
QMap<QString, int> RankFilterALL(QMap<QString, int> mapResult);
|
||||
public:
|
||||
YMPlatformOneFilter();
|
||||
~YMPlatformOneFilter();
|
||||
|
||||
};
|
||||
|
||||
|
||||
class YMPlatformFilter:public YMFilter
|
||||
{
|
||||
protected:
|
||||
QMap<QString, int> Extractor(QMap<QString, int> mapResult);
|
||||
QMap<QString, int> KeywordLengthFilter(QMap<QString, int> mapResult);
|
||||
QMap<QString, int> KeywordFilter(QMap<QString, int> mapResult);
|
||||
QMap<QString, int> RankFilterSeparated(QMap<QString, int> mapResult);
|
||||
QMap<QString, int> RankFilterALL(QMap<QString, int> mapResult);
|
||||
public:
|
||||
YMPlatformFilter();
|
||||
~YMPlatformFilter();
|
||||
|
||||
QMap<QString, int> Exec(QMap<QString, int> mapResult);
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // YMFILTERCHILDREN
|
||||
|
||||
|
||||
@@ -31,6 +31,8 @@ YMNxNMatrixWidget::YMNxNMatrixWidget(QWidget *parent)
|
||||
m_strlistMorphereko << "NNG" <<"NNP"<<"NNB"<<"NNBC"<<"NR"<<"NP"<<"VV"<<"VA"<<"VX"<<"VCP"<<"VCN"<<"MM"<<"MAG"<<"MAJ"<<"IC"<<"JKS"<<"JKC"<<"JKG"<<"JKO"<<"JKB"<<"JKV"<<"JKQ"<<"JX"<<"JC"<<"EP"<<"EF"<<"EC"<<"ETN"<<"ETM"<<"XPN"<<"XSN"<<"XSV"<<"XSA"<<"XR"<<"SF"<<"SE"<<"SSO"<<"SSC"<<"SC"<<"SY"<<"SL"<<"SH"<<"SN";
|
||||
}
|
||||
|
||||
m_strName = "nxnmatrix";
|
||||
|
||||
QVBoxLayout *vMainLayout = new QVBoxLayout;
|
||||
vMainLayout->setAlignment(Qt::AlignVCenter);
|
||||
QVBoxLayout *vboxlayout = new QVBoxLayout;
|
||||
@@ -660,6 +662,82 @@ void YMNxNMatrixWidget::clearView()
|
||||
m_mapViewResult.clear();
|
||||
}
|
||||
|
||||
void YMNxNMatrixWidget::setParam(QString strJson)
|
||||
{
|
||||
SJson json;
|
||||
{
|
||||
int nThread = json.Get(strJson, "Thread").toInt();
|
||||
for(int i = 0; i < m_pcbThread->count(); i++)
|
||||
{
|
||||
//qDebug() << m_pcbThread->itemData(i).toInt();
|
||||
if(m_pcbThread->itemText(i).trimmed().toInt() == nThread)
|
||||
{
|
||||
m_pcbThread->setCurrentIndex(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
QString strCountMethod = json.Get(strJson, "CountMethod").trimmed();
|
||||
for(int i = 0; i < m_pcbCountMethod->count(); i++)
|
||||
{
|
||||
//qDebug() << m_pcbThread->itemData(i).toInt();
|
||||
if(m_pcbCountMethod->itemText(i).trimmed().compare(strCountMethod) == 0)
|
||||
{
|
||||
m_pcbCountMethod->setCurrentIndex(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
QString strRecentPeriod = json.Get(strJson, "RecentPeriod").trimmed();
|
||||
for(int i = 0; i < m_pcbDuring->count(); i++)
|
||||
{
|
||||
//qDebug() << m_pcbThread->itemData(i).toInt();
|
||||
if(m_pcbDuring->itemText(i).trimmed().compare(strRecentPeriod) == 0)
|
||||
{
|
||||
m_pcbDuring->setCurrentIndex(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
int nPeriod = json.Get(strJson, "Period").toInt();
|
||||
m_pcbPeriod->setCurrentIndex(nPeriod);
|
||||
}
|
||||
{
|
||||
int nBodyTitle = json.Get(strJson, "TitleBody").toInt();
|
||||
m_pcbData->setCurrentIndex(nBodyTitle);
|
||||
}
|
||||
{
|
||||
QString strDateAll = json.Get(strJson, "DateALL").trimmed();
|
||||
if(strDateAll.compare("true",Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
m_pcbDate->setCurrentIndex(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcbDate->setCurrentIndex(1);
|
||||
}
|
||||
}
|
||||
{
|
||||
QString strRecentDate = json.Get(strJson, "RecentDate");
|
||||
m_pleDates->setText(strRecentDate);
|
||||
}
|
||||
{
|
||||
|
||||
m_pdeStart->setDate(QDate::fromString(json.Get(strJson,"DateStart"),"yyyyMMdd"));
|
||||
m_pdeEnd->setDate(QDate::fromString(json.Get(strJson,"DateEnd"),"yyyyMMdd"));
|
||||
}
|
||||
|
||||
{
|
||||
QString mKeyword = json.Get(strJson, "MatrixKeyword");
|
||||
m_pleMKeyword->setText(mKeyword);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void YMNxNMatrixWidget::SortViewResult()
|
||||
{
|
||||
/*
|
||||
@@ -942,7 +1020,6 @@ QGroupBox *YMNxNMatrixWidget::setData()
|
||||
}
|
||||
|
||||
|
||||
|
||||
QString YMNxNMatrixWidget::getMatrixKeyword()
|
||||
{
|
||||
return m_pleMKeyword->text().trimmed();
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
bool getDateAll();
|
||||
QString getUserDictList();
|
||||
QString getMatrixKeyword();
|
||||
|
||||
void setParam(QString strJson);
|
||||
private:
|
||||
// Data
|
||||
QListWidget *m_plwData;
|
||||
|
||||
@@ -35,6 +35,8 @@ YMOneDepthWidget::YMOneDepthWidget(QWidget *parent)
|
||||
m_strlistMorphereko << "NNG" <<"NNP"<<"NNB"<<"NNBC"<<"NR"<<"NP"<<"VV"<<"VA"<<"VX"<<"VCP"<<"VCN"<<"MM"<<"MAG"<<"MAJ"<<"IC"<<"JKS"<<"JKC"<<"JKG"<<"JKO"<<"JKB"<<"JKV"<<"JKQ"<<"JX"<<"JC"<<"EP"<<"EF"<<"EC"<<"ETN"<<"ETM"<<"XPN"<<"XSN"<<"XSV"<<"XSA"<<"XR"<<"SF"<<"SE"<<"SSO"<<"SSC"<<"SC"<<"SY"<<"SL"<<"SH"<<"SN";
|
||||
}
|
||||
|
||||
m_strName = "onedepth";
|
||||
|
||||
QVBoxLayout *vMainLayout = new QVBoxLayout;
|
||||
vMainLayout->setAlignment(Qt::AlignVCenter);
|
||||
QVBoxLayout *vboxlayout = new QVBoxLayout;
|
||||
@@ -666,7 +668,7 @@ void YMOneDepthWidget::D3View()
|
||||
"\n}"
|
||||
"\n"
|
||||
"\n.node text {"
|
||||
"\n font: 10px sans-serif;"
|
||||
"\n font: 14px sans-serif;"
|
||||
"\n pointer-events: none;"
|
||||
"\n text-anchor: middle;"
|
||||
"\n}"
|
||||
@@ -682,8 +684,8 @@ void YMOneDepthWidget::D3View()
|
||||
"\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js\"></script>"
|
||||
"\n<script>"
|
||||
"\n"
|
||||
"\nvar width = 1600,"
|
||||
"\n height = 900,"
|
||||
"\nvar width = 1920,"
|
||||
"\n height = 1080,"
|
||||
"\n root;"
|
||||
"\n"
|
||||
"\nvar force = d3.layout.force()"
|
||||
@@ -902,6 +904,141 @@ void YMOneDepthWidget::clearView()
|
||||
m_mapViewResult.clear();
|
||||
m_mapViewResult2.clear();
|
||||
}
|
||||
void YMOneDepthWidget::setParam(QString strJson)
|
||||
{
|
||||
SJson json;
|
||||
{
|
||||
|
||||
QString strMorphere = json.Get(strJson, "MorphereList");
|
||||
QStringList slMorphere = strMorphere.split(" ", QString::SkipEmptyParts);
|
||||
|
||||
for(int i = 0; i < m_plwMorphereAdd->count(); i++)
|
||||
{
|
||||
m_plwMorphereAdd->item(i)->setHidden(true);
|
||||
}
|
||||
|
||||
for(int i = 0; i < m_plwMorphereAdd->count(); i++)
|
||||
{
|
||||
foreach(QString morphere, slMorphere)
|
||||
{
|
||||
if(m_plwMorphereAdd->item(i)->data(Qt::UserRole).toString().compare(morphere, Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
m_plwMorphereAdd->item(i)->setHidden(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
int nThread = json.Get(strJson, "Thread").toInt();
|
||||
for(int i = 0; i < m_pcbThread->count(); i++)
|
||||
{
|
||||
//qDebug() << m_pcbThread->itemData(i).toInt();
|
||||
if(m_pcbThread->itemText(i).trimmed().toInt() == nThread)
|
||||
{
|
||||
m_pcbThread->setCurrentIndex(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
QString strCountMethod = json.Get(strJson, "CountMethod").trimmed();
|
||||
for(int i = 0; i < m_pcbCountMethod->count(); i++)
|
||||
{
|
||||
//qDebug() << m_pcbThread->itemData(i).toInt();
|
||||
if(m_pcbCountMethod->itemText(i).trimmed().compare(strCountMethod) == 0)
|
||||
{
|
||||
m_pcbCountMethod->setCurrentIndex(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
QString strRecentPeriod = json.Get(strJson, "RecentPeriod").trimmed();
|
||||
for(int i = 0; i < m_pcbDuring->count(); i++)
|
||||
{
|
||||
//qDebug() << m_pcbThread->itemData(i).toInt();
|
||||
if(m_pcbDuring->itemText(i).trimmed().compare(strRecentPeriod) == 0)
|
||||
{
|
||||
m_pcbDuring->setCurrentIndex(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
int nPeriod = json.Get(strJson, "Period").toInt();
|
||||
m_pcbPeriod->setCurrentIndex(nPeriod);
|
||||
}
|
||||
{
|
||||
int nBodyTitle = json.Get(strJson, "TitleBody").toInt();
|
||||
m_pcbData->setCurrentIndex(nBodyTitle);
|
||||
}
|
||||
{
|
||||
QString strDateAll = json.Get(strJson, "DateALL").trimmed();
|
||||
if(strDateAll.compare("true",Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
m_pcbDate->setCurrentIndex(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcbDate->setCurrentIndex(1);
|
||||
}
|
||||
}
|
||||
{
|
||||
QString strRecentDate = json.Get(strJson, "RecentDate");
|
||||
m_pleDates->setText(strRecentDate);
|
||||
}
|
||||
{
|
||||
m_pdeStart->setDate(QDate::fromString(json.Get(strJson,"DateStart"),"yyyyMMdd"));
|
||||
m_pdeEnd->setDate(QDate::fromString(json.Get(strJson,"DateEnd"),"yyyyMMdd"));
|
||||
}
|
||||
{
|
||||
QString userdict = json.Get(strJson, "UserDict");
|
||||
if(!userdict.isEmpty())
|
||||
{
|
||||
|
||||
m_pcbDictionary->clear();
|
||||
QStringList sluserdict = userdict.split(",");
|
||||
foreach(QString dict, sluserdict)
|
||||
{
|
||||
m_pcbDictionary->addItem(dict);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcbDictionary->clear();
|
||||
}
|
||||
}
|
||||
{
|
||||
QString extractor = json.Get(strJson, "Extractor");
|
||||
m_pleFilterExtractor->setText(extractor);
|
||||
}
|
||||
{
|
||||
QString keywordfilter = json.Get(strJson, "KeywordFilter");
|
||||
m_pleFilterKeyword->setText(keywordfilter);
|
||||
}
|
||||
{
|
||||
QString keywordlengthfilter = json.Get(strJson, "KeywordLengthFilter");
|
||||
m_pleFilterKeywordLength->setText(keywordlengthfilter);
|
||||
}
|
||||
{
|
||||
QString RankFilterAll = json.Get(strJson, "RankFilterAll");
|
||||
m_pleFilterRankALL->setText(RankFilterAll);
|
||||
}
|
||||
{
|
||||
QString RankSeparated = json.Get(strJson, "RankFilterSeparated");
|
||||
m_pleFilterRankSeparated->setText(RankSeparated);
|
||||
}
|
||||
{
|
||||
QString CenterKeyword = json.Get(strJson, "CenterKeyword");
|
||||
m_pleCKeyword->setText(CenterKeyword);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void YMOneDepthWidget::SortViewResult()
|
||||
{
|
||||
@@ -1244,6 +1381,7 @@ QMap<QString, int> YMOneDepthWidget::getResult()
|
||||
}
|
||||
|
||||
|
||||
|
||||
void YMOneDepthWidget::TestUpload()
|
||||
{
|
||||
//QMap<QString, int> mapResult = m_mapResult;
|
||||
|
||||
@@ -46,6 +46,7 @@ public:
|
||||
QMap<QString, int> getResult();
|
||||
void TestUpload();
|
||||
void D3View();
|
||||
void setParam(QString strJson);
|
||||
private:
|
||||
// Data
|
||||
QListWidget *m_plwData;
|
||||
|
||||
@@ -21,6 +21,11 @@ void YMorphereWidget::clearParam()
|
||||
|
||||
}
|
||||
|
||||
QString YMorphereWidget::getName()
|
||||
{
|
||||
return m_strName;
|
||||
}
|
||||
|
||||
void YMorphereWidget::Exec()
|
||||
{
|
||||
clearResult();
|
||||
@@ -60,6 +65,12 @@ void YMorphereWidget::TestUpload()
|
||||
void YMorphereWidget::D3View()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void YMorphereWidget::setParam(QString strJson)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ protected:
|
||||
QMap <QString, int> m_mapResult;
|
||||
YAlgorithm* m_pYAlgorithm;
|
||||
QTabWidget* m_pTabWidget;
|
||||
QString m_strName;
|
||||
|
||||
public:
|
||||
YMorphereWidget(QWidget *parent = 0);
|
||||
@@ -46,6 +47,8 @@ public:
|
||||
virtual void TestUpload();
|
||||
virtual void D3View();
|
||||
void setTabWidget(QTabWidget* tabWidget);
|
||||
virtual void setParam(QString strJson);
|
||||
QString getName();
|
||||
};
|
||||
|
||||
#endif // YMORPHEREWIDGET
|
||||
|
||||
@@ -37,6 +37,9 @@ YMTwoDepthWidget::YMTwoDepthWidget(QWidget *parent)
|
||||
m_strlistMorphereko << "NNG" <<"NNP"<<"NNB"<<"NNBC"<<"NR"<<"NP"<<"VV"<<"VA"<<"VX"<<"VCP"<<"VCN"<<"MM"<<"MAG"<<"MAJ"<<"IC"<<"JKS"<<"JKC"<<"JKG"<<"JKO"<<"JKB"<<"JKV"<<"JKQ"<<"JX"<<"JC"<<"EP"<<"EF"<<"EC"<<"ETN"<<"ETM"<<"XPN"<<"XSN"<<"XSV"<<"XSA"<<"XR"<<"SF"<<"SE"<<"SSO"<<"SSC"<<"SC"<<"SY"<<"SL"<<"SH"<<"SN";
|
||||
}
|
||||
|
||||
m_strName = "twodepth";
|
||||
|
||||
|
||||
QVBoxLayout *vMainLayout = new QVBoxLayout;
|
||||
vMainLayout->setAlignment(Qt::AlignVCenter);
|
||||
QVBoxLayout *vboxlayout = new QVBoxLayout;
|
||||
@@ -753,6 +756,9 @@ void YMTwoDepthWidget::clearView()
|
||||
m_mapViewResult2.clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void YMTwoDepthWidget::SortViewResult()
|
||||
{
|
||||
if(isSortDateMorphereChecked())
|
||||
@@ -1246,7 +1252,7 @@ void YMTwoDepthWidget::D3View()
|
||||
"\n}"
|
||||
"\n"
|
||||
"\n.node text {"
|
||||
"\n font: 10px sans-serif;"
|
||||
"\n font: 14px sans-serif;"
|
||||
"\n pointer-events: none;"
|
||||
"\n text-anchor: middle;"
|
||||
"\n}"
|
||||
@@ -1262,8 +1268,8 @@ void YMTwoDepthWidget::D3View()
|
||||
"\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js\"></script>"
|
||||
"\n<script>"
|
||||
"\n"
|
||||
"\nvar width = 1600,"
|
||||
"\n height = 900,"
|
||||
"\nvar width = 1920,"
|
||||
"\n height = 1080,"
|
||||
"\n root;"
|
||||
"\n"
|
||||
"\nvar force = d3.layout.force()"
|
||||
@@ -1500,6 +1506,161 @@ void YMTwoDepthWidget::TestUpload()
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
void YMTwoDepthWidget::setParam(QString strJson)
|
||||
{
|
||||
SJson json;
|
||||
{
|
||||
|
||||
QString strMorphere = json.Get(strJson, "MorphereList");
|
||||
QStringList slMorphere = strMorphere.split(" ", QString::SkipEmptyParts);
|
||||
|
||||
for(int i = 0; i < m_plwMorphereAdd->count(); i++)
|
||||
{
|
||||
m_plwMorphereAdd->item(i)->setHidden(true);
|
||||
}
|
||||
|
||||
for(int i = 0; i < m_plwMorphereAdd->count(); i++)
|
||||
{
|
||||
foreach(QString morphere, slMorphere)
|
||||
{
|
||||
if(m_plwMorphereAdd->item(i)->data(Qt::UserRole).toString().compare(morphere, Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
m_plwMorphereAdd->item(i)->setHidden(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
int nThread = json.Get(strJson, "Thread").toInt();
|
||||
for(int i = 0; i < m_pcbThread->count(); i++)
|
||||
{
|
||||
//qDebug() << m_pcbThread->itemData(i).toInt();
|
||||
if(m_pcbThread->itemText(i).trimmed().toInt() == nThread)
|
||||
{
|
||||
m_pcbThread->setCurrentIndex(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
QString strCountMethod = json.Get(strJson, "CountMethod").trimmed();
|
||||
for(int i = 0; i < m_pcbCountMethod->count(); i++)
|
||||
{
|
||||
//qDebug() << m_pcbThread->itemData(i).toInt();
|
||||
if(m_pcbCountMethod->itemText(i).trimmed().compare(strCountMethod) == 0)
|
||||
{
|
||||
m_pcbCountMethod->setCurrentIndex(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
QString strRecentPeriod = json.Get(strJson, "RecentPeriod").trimmed();
|
||||
for(int i = 0; i < m_pcbDuring->count(); i++)
|
||||
{
|
||||
//qDebug() << m_pcbThread->itemData(i).toInt();
|
||||
if(m_pcbDuring->itemText(i).trimmed().compare(strRecentPeriod) == 0)
|
||||
{
|
||||
m_pcbDuring->setCurrentIndex(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
int nPeriod = json.Get(strJson, "Period").toInt();
|
||||
m_pcbPeriod->setCurrentIndex(nPeriod);
|
||||
}
|
||||
{
|
||||
int nBodyTitle = json.Get(strJson, "TitleBody").toInt();
|
||||
m_pcbData->setCurrentIndex(nBodyTitle);
|
||||
}
|
||||
{
|
||||
QString strDateAll = json.Get(strJson, "DateALL").trimmed();
|
||||
if(strDateAll.compare("true",Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
m_pcbDate->setCurrentIndex(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcbDate->setCurrentIndex(1);
|
||||
}
|
||||
}
|
||||
{
|
||||
QString strRecentDate = json.Get(strJson, "RecentDate");
|
||||
m_pleDates->setText(strRecentDate);
|
||||
}
|
||||
{
|
||||
m_pdeStart->setDate(QDate::fromString(json.Get(strJson,"DateStart"),"yyyyMMdd"));
|
||||
m_pdeEnd->setDate(QDate::fromString(json.Get(strJson,"DateEnd"),"yyyyMMdd"));
|
||||
}
|
||||
{
|
||||
QString userdict = json.Get(strJson, "UserDict");
|
||||
if(!userdict.isEmpty())
|
||||
{
|
||||
|
||||
m_pcbDictionary->clear();
|
||||
QStringList sluserdict = userdict.split(",");
|
||||
foreach(QString dict, sluserdict)
|
||||
{
|
||||
m_pcbDictionary->addItem(dict);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pcbDictionary->clear();
|
||||
}
|
||||
}
|
||||
{
|
||||
QString extractor = json.Get(strJson, "Extractor");
|
||||
m_pleFilterExtractor->setText(extractor);
|
||||
}
|
||||
{
|
||||
QString keywordfilter = json.Get(strJson, "KeywordFilter");
|
||||
m_pleFilterKeyword->setText(keywordfilter);
|
||||
}
|
||||
{
|
||||
QString keywordlengthfilter = json.Get(strJson, "KeywordLengthFilter");
|
||||
m_pleFilterKeywordLength->setText(keywordlengthfilter);
|
||||
}
|
||||
{
|
||||
QString RankFilterAll = json.Get(strJson, "RankFilterAll");
|
||||
m_pleFilterRankALL->setText(RankFilterAll);
|
||||
}
|
||||
{
|
||||
QString RankSeparated = json.Get(strJson, "RankFilterSeparated");
|
||||
m_pleFilterRankSeparated->setText(RankSeparated);
|
||||
}
|
||||
{
|
||||
QString CenterKeyword = json.Get(strJson, "CenterKeyword");
|
||||
m_pleCKeyword->setText(CenterKeyword);
|
||||
}
|
||||
{
|
||||
QString extractor = json.Get(strJson, "Extractor2");
|
||||
m_pleFilterExtractor2->setText(extractor);
|
||||
}
|
||||
{
|
||||
QString keywordfilter = json.Get(strJson, "KeywordFilter2");
|
||||
m_pleFilterKeyword2->setText(keywordfilter);
|
||||
}
|
||||
{
|
||||
QString keywordlengthfilter = json.Get(strJson, "KeywordLengthFilter2");
|
||||
m_pleFilterKeywordLength2->setText(keywordlengthfilter);
|
||||
}
|
||||
{
|
||||
QString RankFilterAll = json.Get(strJson, "RankFilterAll2");
|
||||
m_pleFilterRankALL2->setText(RankFilterAll);
|
||||
}
|
||||
{
|
||||
QString RankSeparated = json.Get(strJson, "RankFilterSeparated2");
|
||||
m_pleFilterRankSeparated2->setText(RankSeparated);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
QString YMTwoDepthWidget::getCenterKeyword()
|
||||
{
|
||||
return m_pleCKeyword->text().trimmed();
|
||||
|
||||
@@ -48,6 +48,7 @@ public:
|
||||
QMap<QString, int> getResult();
|
||||
void TestUpload();
|
||||
void D3View();
|
||||
void setParam(QString strJson);
|
||||
private:
|
||||
// Data
|
||||
QListWidget *m_plwData;
|
||||
|
||||
@@ -95,18 +95,13 @@ QGroupBox *YMUploadWidget::setUploadWidgets()
|
||||
|
||||
void YMUploadWidget::AnalysisGroupInsert()
|
||||
{
|
||||
/*
|
||||
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
|
||||
db.setHostName("bigbird.iptime.org");
|
||||
db.setUserName("admin");
|
||||
db.setPassword("admin123");
|
||||
db.setDatabaseName("concepters");
|
||||
*/
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
|
||||
db.setHostName("localhost");
|
||||
db.setUserName("cococo");
|
||||
db.setPassword("admin123");
|
||||
db.setDatabaseName("fbtest");
|
||||
|
||||
if (db.open() == false)
|
||||
{
|
||||
qDebug() << db.lastError().text();
|
||||
@@ -122,18 +117,14 @@ void YMUploadWidget::AnalysisGroupInsert()
|
||||
|
||||
void YMUploadWidget::AnalysisGroupDelete()
|
||||
{
|
||||
/*
|
||||
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
|
||||
db.setHostName("bigbird.iptime.org");
|
||||
db.setUserName("admin");
|
||||
db.setPassword("admin123");
|
||||
db.setDatabaseName("concepters");
|
||||
*/
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
|
||||
db.setHostName("localhost");
|
||||
db.setUserName("cococo");
|
||||
db.setPassword("admin123");
|
||||
db.setDatabaseName("fbtest");
|
||||
|
||||
|
||||
if (db.open() == false)
|
||||
{
|
||||
qDebug() << db.lastError().text();
|
||||
@@ -153,18 +144,13 @@ void YMUploadWidget::AnalysisGroupDelete()
|
||||
|
||||
void YMUploadWidget::AnalysisGroupModify()
|
||||
{
|
||||
/*
|
||||
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
|
||||
db.setHostName("bigbird.iptime.org");
|
||||
db.setUserName("admin");
|
||||
db.setPassword("admin123");
|
||||
db.setDatabaseName("concepters");
|
||||
*/
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
|
||||
db.setHostName("localhost");
|
||||
db.setUserName("cococo");
|
||||
db.setPassword("admin123");
|
||||
db.setDatabaseName("fbtest");
|
||||
|
||||
if (db.open() == false)
|
||||
{
|
||||
qDebug() << db.lastError().text();
|
||||
@@ -182,18 +168,14 @@ void YMUploadWidget::AnalysisGroupModify()
|
||||
|
||||
void YMUploadWidget::AnalysisGroupCopyPaste()
|
||||
{
|
||||
/*
|
||||
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
|
||||
db.setHostName("bigbird.iptime.org");
|
||||
db.setUserName("admin");
|
||||
db.setPassword("admin123");
|
||||
db.setDatabaseName("concepters");
|
||||
*/
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
|
||||
db.setHostName("localhost");
|
||||
db.setUserName("cococo");
|
||||
db.setPassword("admin123");
|
||||
db.setDatabaseName("fbtest");
|
||||
|
||||
|
||||
if (db.open() == false)
|
||||
{
|
||||
qDebug() << db.lastError().text();
|
||||
@@ -222,18 +204,14 @@ void YMUploadWidget::AnalysisGroupCopyPaste()
|
||||
|
||||
void YMUploadWidget::AnalysisGroupRefresh()
|
||||
{
|
||||
/*
|
||||
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
|
||||
db.setHostName("bigbird.iptime.org");
|
||||
db.setUserName("admin");
|
||||
db.setPassword("admin123");
|
||||
db.setDatabaseName("concepters");
|
||||
*/
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
|
||||
db.setHostName("localhost");
|
||||
db.setUserName("cococo");
|
||||
db.setPassword("admin123");
|
||||
db.setDatabaseName("fbtest");
|
||||
|
||||
|
||||
if (db.open() == false)
|
||||
{
|
||||
qDebug() << db.lastError().text();
|
||||
@@ -252,18 +230,14 @@ void YMUploadWidget::AnalysisGroupRefresh()
|
||||
|
||||
void YMUploadWidget::RefreshAnalysis(int _nGroup)
|
||||
{
|
||||
/*
|
||||
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
|
||||
db.setHostName("bigbird.iptime.org");
|
||||
db.setUserName("admin");
|
||||
db.setPassword("admin123");
|
||||
db.setDatabaseName("concepters");
|
||||
*/
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
|
||||
db.setHostName("localhost");
|
||||
db.setUserName("cococo");
|
||||
db.setPassword("admin123");
|
||||
db.setDatabaseName("fbtest");
|
||||
|
||||
|
||||
if (db.open() == false)
|
||||
{
|
||||
qDebug() << db.lastError().text();
|
||||
@@ -309,18 +283,14 @@ void YMUploadWidget::currentGroupItemChanged(QListWidgetItem *_pCurrent, QListWi
|
||||
|
||||
void YMUploadWidget::AnalysisDelete()
|
||||
{
|
||||
/*
|
||||
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
|
||||
db.setHostName("bigbird.iptime.org");
|
||||
db.setUserName("admin");
|
||||
db.setPassword("admin123");
|
||||
db.setDatabaseName("concepters");
|
||||
*/
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
|
||||
db.setHostName("localhost");
|
||||
db.setUserName("cococo");
|
||||
db.setPassword("admin123");
|
||||
db.setDatabaseName("fbtest");
|
||||
|
||||
|
||||
if (db.open() == false)
|
||||
{
|
||||
qDebug() << db.lastError().text();
|
||||
@@ -353,18 +323,14 @@ void YMUploadWidget::AnalysisUp()
|
||||
{
|
||||
int nSelect = m_plwAnalysis->currentRow();
|
||||
if (nSelect <= 0) return;
|
||||
/*
|
||||
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
|
||||
db.setHostName("bigbird.iptime.org");
|
||||
db.setUserName("admin");
|
||||
db.setPassword("admin123");
|
||||
db.setDatabaseName("concepters");
|
||||
*/
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
|
||||
db.setHostName("localhost");
|
||||
db.setUserName("cococo");
|
||||
db.setPassword("admin123");
|
||||
db.setDatabaseName("fbtest");
|
||||
|
||||
|
||||
if (db.open() == false)
|
||||
{
|
||||
qDebug() << db.lastError().text();
|
||||
@@ -388,18 +354,14 @@ void YMUploadWidget::AnalysisDown()
|
||||
if (nSelect < 0) return;
|
||||
if (nSelect >= (m_plwAnalysis->count() - 1)) return;
|
||||
qDebug() << nSelect;
|
||||
/*
|
||||
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
|
||||
db.setHostName("bigbird.iptime.org");
|
||||
db.setUserName("admin");
|
||||
db.setPassword("admin123");
|
||||
db.setDatabaseName("concepters");
|
||||
*/
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
|
||||
db.setHostName("localhost");
|
||||
db.setUserName("cococo");
|
||||
db.setPassword("admin123");
|
||||
db.setDatabaseName("fbtest");
|
||||
|
||||
|
||||
if (db.open() == false)
|
||||
{
|
||||
qDebug() << db.lastError().text();
|
||||
@@ -432,18 +394,14 @@ void YMUploadWidget::DataBaseMorphereAnalysis(int _nArticle,QMap<QString, QStrin
|
||||
|
||||
void YMUploadWidget::DataBaseAnalysis(int _nType, QString _strJson,int _nGroup,int _nCommand,QString _strFilterId)
|
||||
{
|
||||
/*
|
||||
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
|
||||
db.setHostName("bigbird.iptime.org");
|
||||
db.setUserName("admin");
|
||||
db.setPassword("admin123");
|
||||
db.setDatabaseName("concepters");
|
||||
*/
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
|
||||
db.setHostName("localhost");
|
||||
db.setUserName("cococo");
|
||||
db.setPassword("admin123");
|
||||
db.setDatabaseName("fbtest");
|
||||
|
||||
|
||||
|
||||
if (db.open() == false)
|
||||
{
|
||||
@@ -480,27 +438,36 @@ void YMUploadWidget::currentAnalysisItemChanged(QListWidgetItem *_pCurrent, QLis
|
||||
{
|
||||
Q_UNUSED(_pPrev);
|
||||
if (_pCurrent == 0) return;
|
||||
/*
|
||||
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
|
||||
db.setHostName("bigbird.iptime.org");
|
||||
db.setUserName("admin");
|
||||
db.setPassword("admin123");
|
||||
db.setDatabaseName("concepters");
|
||||
*/
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
|
||||
db.setHostName("localhost");
|
||||
db.setUserName("cococo");
|
||||
db.setPassword("admin123");
|
||||
db.setDatabaseName("fbtest");
|
||||
|
||||
if (db.open() == false)
|
||||
{
|
||||
qDebug() << db.lastError().text();
|
||||
return;
|
||||
}
|
||||
QSqlQuery query("select id,type,data from filter where id = " + _pCurrent->data(Qt::UserRole).toString());
|
||||
QSqlQuery query("select id,type,data from analysis where id = " + _pCurrent->data(Qt::UserRole).toString());
|
||||
if (!query.next()) return;
|
||||
SJson json;
|
||||
QString strJson = query.value(2).toString();
|
||||
qDebug() << json.Get(strJson, "Algorithm");
|
||||
qDebug() << m_ptwResult->count();
|
||||
|
||||
for(int i = 0; i < m_ptwResult->count(); i++)
|
||||
{
|
||||
if(((YMorphereWidget*)(m_ptwResult->widget(i)))->getName() == json.Get(strJson, "Algorithm"))
|
||||
{
|
||||
|
||||
((YMorphereWidget*)(m_ptwResult->widget(i)))->setParam(strJson);
|
||||
m_ptwResult->setCurrentIndex(i);
|
||||
qDebug() << json.Get(strJson,"Algorithm");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
switch(query.value(1).toInt())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user