|
| 1 | +package CSV |
| 2 | + |
| 3 | +import ( |
| 4 | + "github.com/Darklabel91/Summary_Classifier" |
| 5 | + "github.com/Darklabel91/Summary_Classifier/Struct" |
| 6 | +) |
| 7 | + |
| 8 | +func CreateCSVs(raw []Struct.Raw_decision, nameResultFolder string) { |
| 9 | + var totalInfered []Struct.Infered_decision |
| 10 | + var exOfficioReview []Struct.Infered_decision |
| 11 | + var diligence []Struct.Infered_decision |
| 12 | + var affected []Struct.Infered_decision |
| 13 | + var partial []Struct.Infered_decision |
| 14 | + var groundless []Struct.Infered_decision |
| 15 | + var hasGround []Struct.Infered_decision |
| 16 | + var noInfo []Struct.Infered_decision |
| 17 | + var notMap []Struct.Infered_decision |
| 18 | + |
| 19 | + for i := 0; i < len(raw); i++ { |
| 20 | + emp := Summary_Classifier.SummaryClassifier(raw[i].Summary, raw[i].Identifier, raw[i].Court) |
| 21 | + totalInfered = append(totalInfered, emp) |
| 22 | + if emp.Class == "Reexame Necessário" { |
| 23 | + exOfficioReview = append(exOfficioReview, emp) |
| 24 | + } else if emp.Class == "Convertido em Diligência" { |
| 25 | + diligence = append(diligence, emp) |
| 26 | + } else if emp.Class == "Prejudicado" { |
| 27 | + affected = append(affected, emp) |
| 28 | + } else if emp.Class == "Parcial Provimento" { |
| 29 | + partial = append(partial, emp) |
| 30 | + } else if emp.Class == "Improvimento" { |
| 31 | + groundless = append(groundless, emp) |
| 32 | + } else if emp.Class == "Provimento" { |
| 33 | + hasGround = append(hasGround, emp) |
| 34 | + } else if emp.Class == "Sem Informação" { |
| 35 | + noInfo = append(noInfo, emp) |
| 36 | + } else if emp.Class == "Não Mapeado" { |
| 37 | + notMap = append(notMap, emp) |
| 38 | + } |
| 39 | + |
| 40 | + } |
| 41 | + |
| 42 | + exportCSV("totalInfered", nameResultFolder, totalInfered) |
| 43 | + |
| 44 | + if len(exOfficioReview) != 0 { |
| 45 | + exportCSV("exOfficioReview", nameResultFolder, exOfficioReview) |
| 46 | + } |
| 47 | + if len(diligence) != 0 { |
| 48 | + exportCSV("diligence", nameResultFolder, diligence) |
| 49 | + } |
| 50 | + if len(affected) != 0 { |
| 51 | + exportCSV("affected", nameResultFolder, affected) |
| 52 | + } |
| 53 | + if len(partial) != 0 { |
| 54 | + exportCSV("partial", nameResultFolder, partial) |
| 55 | + } |
| 56 | + if len(groundless) != 0 { |
| 57 | + exportCSV("groundless", nameResultFolder, groundless) |
| 58 | + } |
| 59 | + if len(hasGround) != 0 { |
| 60 | + exportCSV("hasGround", nameResultFolder, hasGround) |
| 61 | + } |
| 62 | + if len(noInfo) != 0 { |
| 63 | + exportCSV("noInfo", nameResultFolder, noInfo) |
| 64 | + } |
| 65 | + if len(notMap) != 0 { |
| 66 | + exportCSV("notMap", nameResultFolder, notMap) |
| 67 | + } |
| 68 | +} |
0 commit comments