Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
loribeiro committed Aug 23, 2018
0 parents commit 9409e8a
Show file tree
Hide file tree
Showing 26 changed files with 4,993 additions and 0 deletions.
34 changes: 34 additions & 0 deletions analyzer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import networkx as nx
import sys
def estatisticas(endereco,arq):
arquivo = open(endereco+'/'+arq+'_estatisticas.csv', 'w')
e= endereco+'/'+arq+'Convertido.redeFras.csv'
graph = nx.read_edgelist(
e)
nx.to_directed(graph)
clust_coeficients = nx.clustering(graph)
dict_betweenes = nx.betweenness_centrality(graph)
closeness = nx.closeness_centrality(graph)
eigenvector_centrality = nx.eigenvector_centrality(graph)
centralidade_grau = nx.degree_centrality(graph)
grau = nx.degree(graph)
#modularidade = nx.modularity_matrix(graph)
#centro= nx.center(graph,e=None, usebounds=False)
# diametro= nx.diameter(graph,e=None, usebounds=False)
densidade = nx.density(graph)
print densidade
arquivo.write("No ; Grau ; Betweennes ; Centralidade_Grau ; Centralidade(Closeness) ; Eigenvector_Centrality ; Clustering\n")
for key in dict_betweenes.keys():
aux = str(dict_betweenes[key])
aux1= str(grau[key])
aux2= str(centralidade_grau[key])
aux3= str(closeness[key])
aux4= str(eigenvector_centrality[key])
aux5= str(clust_coeficients[key])
arquivo.write(key + ' ; '+aux1+' ; '+ aux +' ; '+aux2 +' ; '+aux3+' ; '+aux4+' ; '+aux+ '\n')
arquivo.close()

ende=str(sys.argv[1])
arq=str(sys.argv[2])
estatisticas(ende,arq)

48 changes: 48 additions & 0 deletions config.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#include "config.h"
#include "ui_config.h"
#include <fstream>
#include <iostream>
using namespace std;

config::config(QWidget *parent) :
QDialog(parent),
ui(new Ui::config)
{
ui->setupUi(this);

string maxLinha;

fstream arqGr,arqPl;
arqGr.open("gramat.ftl",ios_base::in);
if(!arqGr.is_open())
arqGr.open("gramat.ftl",ios_base::out);
arqPl.open("palav.ftl",ios_base::in);
if(!arqPl.is_open())
arqPl.open("palav.ftl",ios_base::out);
while(!arqGr.eof())
{
getline(arqGr,maxLinha);
this->ui->gramat->append(QString(maxLinha.c_str()));
}

while(!arqPl.eof())
{
getline(arqPl,maxLinha);
this->ui->palavr->append(QString(maxLinha.c_str()));
}
arqGr.close();
arqPl.close();
}

config::~config()
{
ofstream arqGr,arqPl;
arqGr.open("gramat.ftl");
arqGr << this->ui->gramat->toPlainText().toStdString();
arqGr.close();
arqPl.open("palav.ftl");
arqPl << this->ui->palavr->toPlainText().toStdString();
arqPl.close();

delete ui;
}
22 changes: 22 additions & 0 deletions config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef CONFIG_H
#define CONFIG_H

#include <QDialog>

namespace Ui {
class config;
}

class config : public QDialog
{
Q_OBJECT

public:
explicit config(QWidget *parent = 0);
~config();

private:
Ui::config *ui;
};

#endif // CONFIG_H
98 changes: 98 additions & 0 deletions config.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>config</class>
<widget class="QDialog" name="config">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>FILTROS A SEREM ELIMINADOS NA CONSTRUÇÃO DAS REDES</string>
</property>
</widget>
</item>
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Classes Gramaticais</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QTextEdit" name="gramat"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Palavras</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QTextEdit" name="palavr"/>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>config</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>config</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
7 changes: 7 additions & 0 deletions contapalavras.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "contapalavras.h"
#include <fstream>

contaPalavras::contaPalavras()
{
}

10 changes: 10 additions & 0 deletions contapalavras.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef CONTAPALAVRAS_H
#define CONTAPALAVRAS_H

class contaPalavras
{
public:
contaPalavras();
};

#endif // CONTAPALAVRAS_H
5 changes: 5 additions & 0 deletions desktop.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[.ShellClassInfo]
InfoTip=Esta pasta está compartilhada on-line.
IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe
IconIndex=16

23 changes: 23 additions & 0 deletions dialogcrece.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include "dialogcrece.h"
#include "ui_dialogcrece.h"

DialogCrece::DialogCrece(QWidget *parent) :
QDialog(parent),
ui(new Ui::DialogCrece)
{
ui->setupUi(this);
}

DialogCrece::~DialogCrece()
{
delete ui;
}

QString DialogCrece::getClasses()
{
return ui->ClassesLineEdit->text();
}
int DialogCrece::getPasso()
{
return this->ui->PassoSpinBox->value();
}
24 changes: 24 additions & 0 deletions dialogcrece.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifndef DIALOGCRECE_H
#define DIALOGCRECE_H

#include <QDialog>

namespace Ui {
class DialogCrece;
}

class DialogCrece : public QDialog
{
Q_OBJECT

public:
explicit DialogCrece(QWidget *parent = 0);
QString getClasses();
int getPasso();
~DialogCrece();

private:
Ui::DialogCrece *ui;
};

#endif // DIALOGCRECE_H
113 changes: 113 additions & 0 deletions dialogcrece.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DialogCrece</class>
<widget class="QDialog" name="DialogCrece">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>611</width>
<height>138</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Passo, em quantidade de palavras </string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="PassoSpinBox">
<property name="maximum">
<number>999999999</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Classes separadas por vírgula</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="ClassesLineEdit"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>DialogCrece</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>DialogCrece</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
Loading

0 comments on commit 9409e8a

Please sign in to comment.