Skip to content

Commit

Permalink
Refactor Censored dto.
Browse files Browse the repository at this point in the history
  • Loading branch information
Twinkle942910 committed Apr 16, 2018
1 parent b8ec93b commit 9435a04
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@
<version>${aho.corasick.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.0</version>
</dependency>

</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public Censored searchForProfanity(String input) {
LOGGER.debug("Censored text: " + input);
LOGGER.debug("Censoring took time: " + (endProccessingTime - startProccessingTime) / (double) 1000000 + " ms");

return new Censored(input, badWords);
return new Censored(input, badWords, !badWords.isEmpty());
}

public void changeLanguage(Language language){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.filter.textcorrector.profanity_filtering.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
Expand All @@ -10,6 +11,12 @@
@NoArgsConstructor
@AllArgsConstructor
public class Censored {
@JsonProperty("censored_text")
private String censoredText;

@JsonProperty("bad_words")
private Set<String> badWordList;

@JsonProperty("contains_profanity")
private boolean containsProfanity;
}

0 comments on commit 9435a04

Please sign in to comment.