Skip to content

Commit

Permalink
Splitting text by commas
Browse files Browse the repository at this point in the history
  • Loading branch information
isc-lperezra committed Aug 27, 2024
1 parent 6ba7974 commit a9b654d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions encoder-ui/src/app/analyzer/analyzer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ export class AnalyzerComponent {
var textHTML = this.textToAnalyze?.value;
var textOriginal = textHTML;
var textToProcess = this.textToAnalyze?.value.split(".").filter(Boolean);
var forReading = 100/(textToProcess.length);
var piecedTextToProcess: any[] = [];
for (var index in textToProcess){
piecedTextToProcess = piecedTextToProcess.concat(textToProcess[index].split(","))
}
var forReading = 100/(piecedTextToProcess.length);
this.totalReceived = 0;
this.error = false;
this.loading = true;
Expand All @@ -59,13 +63,13 @@ export class AnalyzerComponent {
"Text": textOriginal
};
this.irisService.saveRawText(rawText).subscribe({next: raw => {
this.totalReceived = (100%(textToProcess.length)) + 1;
for (var index in textToProcess){
if (textToProcess[index] !== "")
this.totalReceived = (100%(piecedTextToProcess.length)) + 1;
for (var index in piecedTextToProcess){
if (piecedTextToProcess[index] !== "")
{
const textData = {
"ID": raw.id,
"Text": textToProcess[index],
"Text": piecedTextToProcess[index],
"Language": this.translocoService.getActiveLang()
};
this.irisService.analyzeText(textData).subscribe({next: resp =>{
Expand Down

0 comments on commit a9b654d

Please sign in to comment.