MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / extractInfo

Method extractInfo

Libs/srtparser/srtparser.h:378–569  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376}
377
378inline void SubtitleItem::extractInfo(bool keepHTML, bool doNotIgnoreNonDialogues, bool doNotRemoveSpeakerNames) //process subtitle
379{
380 std::string output = _text;
381
382 //stripping HTML tags
383 if(!keepHTML)
384 {
385 /*
386 * TODO : Before erasing, extract the words.
387 * std::vector<std::string> getStyleTags();
388 * int getStyleTagCount() const;
389 * std::vector<std::string> _styleTag;
390 * int _styleTagCount;
391 */
392
393 int countP = 0;
394 for(char& c : output) // replacing <...> with ~~~~
395 {
396 if(c=='<')
397 {
398 countP++;
399 c = '~';
400 }
401
402 else
403 {
404 if(countP!=0)
405 {
406 if(c != '>')
407 c = '~';
408
409 else if(c == '>')
410 {
411 c = '~';
412 countP--;
413 }
414 }
415 }
416 }
417 }
418
419 //stripping non dialogue data e.g. (applause)
420
421 if(!doNotIgnoreNonDialogues)
422 {
423 /*
424 * TODO : Before erasing, extract the words.
425 * std::vector<std::string> getNonDialogueWords();
426 * int getNonDialogueCount() const;
427 * std::vector<std::string> _nonDialogue;
428 * int _nonDialogueCount;
429 */
430
431 int countP = 0;
432 for(char& c : output) // replacing (...) with ~~~~
433 {
434 if(c=='(')
435 {

Callers

nothing calls this directly

Calls 7

removeFunction · 0.85
eraseMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected