Ticket #4327: eitfixup16.patch

File eitfixup16.patch, 23.7 KB (added by john {at} pullan {dot} org, 16 years ago)

Various fixes

  • libs/libmythtv/eitfixup.cpp

     
    1717      m_bellPPVDescriptionAllDay("^\\(.*\\sEastern\\)"),
    1818      m_bellPPVDescriptionAllDay2("^\\([0-9].*am-[0-9].*am\\sET\\)"),
    1919      m_bellPPVDescriptionEventId("\\([0-9]{5}\\)"),
    20       m_ukSubtitle("\\[.*S\\]"),
     20
    2121      m_ukThen("\\s*(Then|Followed by) 60 Seconds\\.", false),
    22       m_ukNew("\\s*(Brand New|New)\\s*(Series|Episode)\\s*[:\\.\\-]",false),
    23       m_ukT4("^[tT]4:"),
    24       m_ukEQ("[:\\!\\?]"),
    25       m_ukEPQ("[:\\!\\.\\?]"),
    26       m_ukPStart("^\\.+"),
    27       m_ukPEnd("\\.+$"),
    28       m_ukSeries1("\\s*(\\d{1,2})/(\\d{1,2})"),
    29       m_ukSeries2("\\((Part|Pt)\\s+(\\d{1,2})\\s+of\\s+(\\d{1,2})\\)", false),
    30       m_ukSeries3("\\s*Episode\\s+(\\d{1,2})\\s+of\\s+(\\d{1,2})\\.", false),
     22      m_ukNew("(New\\.|\\s*(Brand New|New)\\s*(Series|Episode)\\s*[:\\.\\-])",false),
     23      m_ukCEPQ("[:\\!\\.\\?]"),
     24      m_ukColonPeriod("[:\\.]"),
     25      m_ukDotSpaceStart("^\\. "),
     26      m_ukDotEnd("\\.$"),
     27      m_ukSpaceColonStart("^[ |:]*"),
     28      m_ukSpaceStart("^ "),
     29      m_ukSeries1("\\s*(?:\\(|)(\\d{1,2})/(\\d{1,2})(?:\\)|)\\.*"),
     30      m_ukSeries2("\\((?:Part|Pt)\\s+(\\d{1,2})\\s+of\\s+(\\d{1,2})\\)[:|\\.|\\s]", false),
     31      m_ukSeries3("\\s*Episode\\s+(\\d{1,2})\\s+of\\s+(\\d{1,2})[:|\\.|\\s]", false),
    3132      m_ukCC("\\[(AD)(,(S)){,1}(,SL){,1}\\]|\\[(S)(,AD){,1}(,SL){,1}\\]|"
    3233             "\\[(SL)(,AD){,1}(,(S)){,1}\\]"),
    3334      m_ukYear("[\\[\\(]([\\d]{4})[\\)\\]]"),
    3435      m_uk24ep("^\\d{1,2}:00[ap]m to \\d{1,2}:00[ap]m: "),
    35       m_ukStarring("(?:Western\\s)?[Ss]tarring ([\\w\\s\\-']+)[Aa]nd\\s([\\w\\s\\-']+)[\\.|,](?:\\s)*(\\d{4})?(?:\\.\\s)?"),
     36      m_ukStarring2("(?:Western\\s)?[Ss]tarring ([\\w\\s\\-']+)[Aa]nd\\s([\\w\\s\\-']+)[\\.|,](?:\\s)*(\\d{4})?(?:\\.\\s)?"),
    3637      m_ukBBC7rpt("\\[Rptd?[^]]+\\d{1,2}\\.\\d{1,2}[ap]m\\]\\."),
    37       m_ukCBBC("^CBBC\\s*[\\.]"),
    38       m_ukCBeebies("^CBeebies\\s*[\\.]"),
    39       m_ukStarring1("star(ring|s)"),
     38      m_ukDescriptionRemove("^(?:CBBC\\s*\\.|CBeebies\\s*\\.|Class TV\\s*:|BBC Switch\\.)"),
     39      m_ukTitleRemove("^(?:[tT]4:|Schools\\s*:)"),
    4040      m_ukDoubleDotEnd("\\.\\.+$"),
    4141      m_ukDoubleDotStart("^\\.\\.+"),
    42       m_ukDotSpaceStart("^\\. "),
    4342      m_ukTime("\\d{1,2}[\\.:]\\d{1,2}\\s*(am|pm|)"),
    44       m_ukBBC34("BBC [THREE|FOUR] on BBC [ONE|TWO]\\.",false),
    45       m_ukBBCSwitch("BBC Switch\\."),
    46       m_ukYearColon("^\\d\\d\\d\\d:"),
     43      m_ukBBC34("BBC (?:THREE|FOUR) on BBC (?:ONE|TWO)\\.",false),
     44      m_ukYearColon("^[\\d]{4}:"),
     45      m_ukExclusionFromSubtitle("(starring|stars\\s|drama|series|sitcom)",false),
     46      m_ukCompleteDots("^\\.\\.+$"),
     47
    4748      m_comHemCountry("^(\\(.+\\))?\\s?([^ ]+)\\s([^\\.0-9]+)"
    4849                      "(?:\\sfrån\\s([0-9]{4}))(?:\\smed\\s([^\\.]+))?\\.?"),
    4950      m_comHemDirector("[Rr]egi"),
     
    298299
    299300}
    300301
     302/** \fn EITFixUp::SetUKSubtitle(DBEvent&) const
     303 *  \brief Use this in the United Kingdom to standardize DVB-T guide.
     304 */
    301305void EITFixUp::SetUKSubtitle(DBEvent &event) const
    302306{
    303     QStringList strList1;
    304     int position1;
    305     int position2;
     307    QStringList strListColon = QStringList::split(":",event.description,TRUE);
     308    QStringList strListEnd;
    306309
    307     if ((position1 = event.description.find(m_ukEQ)) != -1)
     310    bool fColon = false;
     311    int nPosition1;
     312    QString strEnd;
     313    if (strListColon.count()>1)
    308314    {
    309         position2 = event.description.find(":",position1+1);
    310         if (position2 != -1)
    311         {
    312              strList1 = QStringList::split(" ",
    313                             event.description.mid(position1+1,
    314                             position2-position1+1));
    315              if (strList1.count() < kDotToTitle)
     315         bool fDoubleDot = false;
     316         bool fSingleDot = true;
     317         int nLength = strListColon[0].length();
     318
     319         nPosition1 = event.description.find("..");
     320         if ((nPosition1 < nLength) && (nPosition1 >= 0))
     321             fDoubleDot = true;
     322         nPosition1 = event.description.find(".");
     323         if (nPosition1==-1)
     324             fSingleDot = false;
     325         if (nPosition1 > nLength)
     326             fSingleDot = false;
     327         else
     328         {
     329             QString strTmp = event.description.mid(nPosition1+1,
     330                                     nLength-nPosition1);
     331
     332             if (QStringList::split(" ", strTmp ,TRUE).count()< kMaxDotToColon)
     333                 fSingleDot = false;
     334         }
     335   
     336         if (fDoubleDot)
     337         {
     338             strListEnd = strListColon;
     339             fColon = true;
     340         }
     341         else if (!fSingleDot)
     342         {
     343             QStringList strListTmp;
     344             uint nTitle=0;
     345             int nTitleMax=-1;
     346             int i;
     347             for (i =0; (i<(int)strListColon.count()) && (nTitleMax==-1);i++)
    316348             {
    317                  event.subtitle = event.description.left(position2);
    318                  event.description = event.description.mid(position2 + 1);
     349                 if ((nTitle+=
     350                     QStringList::split(" ",strListColon[i],TRUE).count())
     351                          <kMaxToTitle)
     352                     strListTmp.push_back(strListColon[i]);
     353                 else
     354                     nTitleMax=i;
    319355             }
    320              else
     356             QString strPartial;
     357             for (i=0;i<(nTitleMax-1);i++)
     358                 strPartial+=strListTmp[i]+":";
     359             if (nTitleMax>0)
    321360             {
    322                  event.subtitle = event.description.left(position1);
    323                  event.description = event.description.mid(position1 + 1);
     361                 strPartial+=strListTmp[nTitleMax-1];
     362                 strListEnd.push_back(strPartial);
    324363             }
     364             for (i=nTitleMax+1;i<(int)strListColon.count();i++)
     365                 strListEnd.push_back(strListColon[i]);
     366             fColon = true;
     367         }
     368    }
     369    QStringList strListPeriod;
     370    QStringList strListQuestion;
     371    QStringList strListExcl;
     372    if (!fColon)
     373    {
     374        strListPeriod = QStringList::split(".",event.description,TRUE);
     375        if (strListPeriod.count() >1)
     376        {
     377            nPosition1 = event.description.find(".");
     378            int nPosition2 = event.description.find("..");
     379            if ((nPosition1 < nPosition2) || (nPosition2==-1))
     380                strListEnd = strListPeriod;
    325381        }
     382
     383        strListQuestion = QStringList::split("?",event.description,TRUE);
     384        strListExcl = QStringList::split("!",event.description,TRUE);
     385        if ((strListQuestion.count()>1) &&
     386                 (strListQuestion.count()<=kMaxQuestionExclamation))
     387        {
     388            strListEnd = strListQuestion;
     389            strEnd = "?";
     390        }
     391        else if ((strListExcl.count()>1) &&
     392                 (strListExcl.count()<=kMaxQuestionExclamation))
     393        {
     394            strListEnd = strListExcl;
     395            strEnd = "!";
     396        }
    326397        else
     398            strEnd = QString::null;
     399    }
     400
     401    if (strListEnd.count())
     402    {
     403        QStringList strListSpace = QStringList::split(" ",strListEnd[0]);
     404        if (fColon && (strListSpace.count() > kMaxToTitle))
     405             return;
     406        if (strListSpace.count() > kDotToTitle)
     407             return;
     408        if (strListSpace.grep(m_ukExclusionFromSubtitle).count()==0)
    327409        {
    328             strList1 = QStringList::split(" ",
    329                             event.description.left(position1));
    330             if (strList1.count() < kDotToTitle)
    331             {
    332                 if ((uint)position1 < SUBTITLE_MAX_LEN)
    333                 {
    334                      event.subtitle = event.description.left(position1);
    335                      event.description = event.description.mid(position1+1);
    336                 }
    337             }
     410             event.subtitle = strListEnd[0]+strEnd;
     411             event.subtitle.remove(m_ukSpaceColonStart);
     412             event.description=
     413                          event.description.mid(strListEnd[0].length()+1);
     414             event.description.remove(m_ukSpaceColonStart);
    338415        }
    339416    }
    340417}
    341418
     419
    342420/** \fn EITFixUp::FixUK(DBEvent&) const
    343421 *  \brief Use this in the United Kingdom to standardize DVB-T guide.
    344422 */
     
    348426    int position2;
    349427    QString strFull;
    350428
    351     position1 = event.description.find(m_ukSubtitle);
    352     if (position1 != -1)
    353     {
    354         event.subtitleType |= SUB_NORMAL;
    355         event.description.remove(m_ukSubtitle);
    356     }
    357 
     429    bool isMovie = event.category.startsWith("Movie",false);
    358430    // BBC three case (could add another record here ?)
    359431    event.description = event.description.remove(m_ukThen);
    360432    event.description = event.description.remove(m_ukNew);
    361     event.title  = event.title.remove(m_ukT4);
    362433
    363     // Removal of CBBC and CBeebies
    364     event.description = event.description.remove(m_ukCBBC);
    365     event.description = event.description.remove(m_ukCBeebies);
     434    // Removal of Class TV, CBBC and CBeebies etc..
     435    event.title = event.title.remove(m_ukTitleRemove);
     436    event.description = event.description.remove(m_ukDescriptionRemove);
    366437
    367438    // Removal of BBC FOUR and BBC THREE
    368439    event.description = event.description.remove(m_ukBBC34);
    369440
    370     // Removal of BBC Switch
    371     event.description = event.description.remove(m_ukBBCSwitch);
    372 
    373441    // BBC 7 [Rpt of ...] case.
    374442    event.description = event.description.remove(m_ukBBC7rpt);
    375443
     444    // Remove [AD,S] etc.
     445    event.description = event.description.remove(m_ukCC);
     446
    376447    event.title = event.title.stripWhiteSpace();
    377448    event.description = event.description.stripWhiteSpace();
    378449
    379     QRegExp tmp24ep = m_uk24ep;
    380     if (!event.title.startsWith("CSI:") && !event.title.startsWith("CD:"))
    381     {
    382         if (((position1=event.title.find(m_ukDoubleDotEnd)) != -1) &&
    383             ((position2=event.description.find(m_ukDoubleDotStart)) != -1))
    384         {
    385             strFull = event.title.remove(m_ukDoubleDotEnd)+" "+
    386                   event.description.remove(m_ukDoubleDotStart);
    387             if ((position1 = strFull.find(m_ukEPQ)) != -1)
    388             {
    389                  if (strFull[position1] == '!' || strFull[position1] == '?' ||
    390                      strFull[position1] == '.')
    391                      position1++;
    392                  event.title = strFull.left(position1);
    393                  event.description = strFull.mid(position1 + 1);
    394                  SetUKSubtitle(event);
    395             }
    396             if ((position1 = strFull.find(m_ukYear)) != -1)
    397             {
    398                 // Looks like they are using the airdate as a delimiter
    399                 if ((uint)position1 < SUBTITLE_MAX_LEN)
    400                 {
    401                     event.description = event.title.mid(position1);
    402                     event.title = event.title.left(position1);
    403                 }
    404             }
    405         }
    406         else if ((position1 = tmp24ep.search(event.description)) != -1)
    407         {
    408             // Special case for episodes of 24.
    409             // -2 from the length cause we don't want ": " on the end
    410             event.subtitle = event.description.mid(position1,
    411                                 tmp24ep.cap(0).length() - 2);
    412             event.description = event.description.remove(tmp24ep.cap(0));
    413         }
    414         else if ((position1 = event.description.find(m_ukTime)) == -1)
    415         {
    416             if (event.title.find(m_ukYearColon) < 0)
    417             {
    418                 if (((position1 = event.title.find(":")) != -1) &&
    419                     (event.description.find(":") < 0 ))
    420                 {
    421                     if ((uint)position1 < SUBTITLE_MAX_LEN)
    422                     {
    423                         event.subtitle = event.title.mid(position1 + 1);
    424                         event.title = event.title.left(position1);
    425                     }
    426                 }
    427                 else
    428                     SetUKSubtitle(event);
    429             }
    430         }
    431     }
    432 
    433     if ((event.description.find(m_ukTime) == -1) && (event.subtitle.isEmpty()))
    434     {
    435        QStringList strList1 = QStringList::split(".",event.description,TRUE);
    436        QStringList strList2 = QStringList::split("?",event.description,TRUE);
    437        if (strList1.count()>1 || strList2.count()>1)
    438        {
    439            QString strEnd;
    440            if (strList1[0].length() > strList2[0].length())
    441            {
    442                strList1=strList2;
    443                strEnd="?";
    444            }
    445            strList2 = QStringList::split(" ",strList1[0]);
    446            if (strList2.count() < kDotToTitle)
    447            {
    448                QStringList strList3 = strList2.grep("Drama",false);
    449                QStringList strList4 = strList2.grep("sitcom",false);
    450                QStringList strList5 = strList2.grep(m_ukStarring1);
    451                QStringList strList6 = strList2.grep("Series",false);
    452                if ((strList3.count()==0) && (strList4.count()==0) &&
    453                    (strList5.count()==0) && (strList6.count()==0))
    454                {
    455                     event.subtitle = strList1[0]+strEnd;
    456                     event.description=
    457                                  event.description.mid(strList1[0].length()+1);
    458                }
    459            }
    460        }
    461     }
    462 
    463     QRegExp tmpStarring = m_ukStarring;
    464     if (tmpStarring.search(event.subtitle) != -1)
    465     {
    466         // If the "Starring..." string got promoted to subtitle move it back.
    467         event.description.prepend(". ");
    468         event.description.prepend(tmpStarring.cap(0));
    469         event.subtitle.remove(tmpStarring.cap(0));
    470     }
    471     tmpStarring = m_ukStarring;
    472     if (tmpStarring.search(event.description) != -1)
    473     {
    474         // if we match this we've captured 2 actors and an (optional) airdate
    475         event.AddPerson(DBPerson::kActor, tmpStarring.cap(1));
    476         event.AddPerson(DBPerson::kActor, tmpStarring.cap(2));
    477         if (tmpStarring.cap(3).length() > 0)
    478         {
    479             event.airdate = tmpStarring.cap(3);
    480             bool ok;
    481             uint y = tmpStarring.cap(3).toUInt(&ok);
    482             if (ok)
    483                 event.originalairdate = QDate(y, 1, 1);
    484         }
    485     }
    486 
    487450    // Work out the episode numbers (if any)
    488451    bool    series  = false;
    489452    QRegExp tmpExp1 = m_ukSeries1;
     
    502465            series = true;
    503466        }
    504467    }
    505     else if ((position1 = tmpExp1.search(event.subtitle)) != -1)
    506     {
    507         if ((tmpExp1.cap(1).toUInt() <= tmpExp1.cap(2).toUInt())
    508             && tmpExp1.cap(2).toUInt()<=50)
    509         {
    510             event.partnumber = tmpExp1.cap(1).toUInt();
    511             event.parttotal  = tmpExp1.cap(2).toUInt();
    512             // Remove from the subtitle
    513             event.subtitle = event.subtitle.left(position1) +
    514                 event.subtitle.mid(position1 + tmpExp1.cap(0).length());
    515             series = true;
    516         }
    517     }
    518468    else if ((position1 = tmpExp1.search(event.description)) != -1)
    519469    {
    520470        if ((tmpExp1.cap(1).toUInt() <= tmpExp1.cap(2).toUInt())
     
    530480    }
    531481    else if ((position1 = tmpExp2.search(event.description)) != -1)
    532482    {
    533         event.partnumber = tmpExp2.cap(2).toUInt();
    534         event.parttotal  = tmpExp2.cap(3).toUInt();
     483        event.partnumber = tmpExp2.cap(1).toUInt();
     484        event.parttotal  = tmpExp2.cap(2).toUInt();
    535485        // Remove from the description
    536486        event.description = event.description.left(position1) +
    537487            event.description.mid(position1+tmpExp2.cap(0).length());
     
    549499    if (series)
    550500        event.category_type = kCategorySeries;
    551501
    552     // Work out the closed captions and Audio descriptions  (if any)
    553     QStringList captures;
    554     QStringList::const_iterator it;
    555     QRegExp tmpUKCC = m_ukCC;
    556     if ((position1 = tmpUKCC.search(event.description)) != -1)
     502    QRegExp tmpStarring2 = m_ukStarring2;
     503    if (tmpStarring2.search(event.description) != -1)
    557504    {
    558         // Enumerate throught and see if we have subtitles, don't modify
    559         // the description as we might destroy other useful information
    560         captures = tmpUKCC.capturedTexts();
    561         for (it = captures.begin(); it != captures.end(); ++it)
     505        // if we match this we've captured 2 actors and an (optional) airdate
     506        event.AddPerson(DBPerson::kActor, tmpStarring2.cap(1));
     507        event.AddPerson(DBPerson::kActor, tmpStarring2.cap(2));
     508        if (tmpStarring2.cap(3).length() > 0)
    562509        {
    563             if (*it == "S")
    564                 event.subtitleType |= SUB_NORMAL;
     510            event.airdate = tmpStarring2.cap(3);
     511            bool ok;
     512            uint y = tmpStarring2.cap(3).toUInt(&ok);
     513            if (ok)
     514                event.originalairdate = QDate(y, 1, 1);
    565515        }
    566516    }
    567     else if ((position1 = tmpUKCC.search(event.subtitle)) != -1)
     517
     518    QRegExp tmp24ep = m_uk24ep;
     519    if (!event.title.startsWith("CSI:") && !event.title.startsWith("CD:"))
    568520    {
    569         captures = tmpUKCC.capturedTexts();
    570         for (it = captures.begin(); it != captures.end(); ++it)
     521        if (((position1=event.title.find(m_ukDoubleDotEnd)) != -1) &&
     522            ((position2=event.description.find(m_ukDoubleDotStart)) != -1))
    571523        {
    572             if (*it == "S")
    573                 event.subtitleType |= SUB_NORMAL;
     524            QString strPart=event.title.remove(m_ukDoubleDotEnd)+" ";
     525            strFull = strPart + event.description.remove(m_ukDoubleDotStart);
     526            if (isMovie &&
     527                ((position1 = strFull.find(m_ukCEPQ,strPart.length())) != -1))
     528            {
     529                 if (strFull[position1] == '!' || strFull[position1] == '?')
     530                     position1++;
     531                 event.title = strFull.left(position1);
     532                 event.description = strFull.mid(position1 + 1);
     533                 event.description.remove(m_ukSpaceStart);
     534            }
     535            else if ((position1 = strFull.find(m_ukCEPQ)) != -1)
     536            {
     537                 if (strFull[position1] == '!' || strFull[position1] == '?')
     538                     position1++;
     539                 event.title = strFull.left(position1);
     540                 event.description = strFull.mid(position1 + 1);
     541                 event.description.remove(m_ukSpaceStart);
     542                 SetUKSubtitle(event);
     543            }
     544            if ((position1 = strFull.find(m_ukYear)) != -1)
     545            {
     546                // Looks like they are using the airdate as a delimiter
     547                if ((uint)position1 < SUBTITLE_MAX_LEN)
     548                {
     549                    event.description = event.title.mid(position1);
     550                    event.title = event.title.left(position1);
     551                }
     552            }
    574553        }
     554        else if ((position1 = tmp24ep.search(event.description)) != -1)
     555        {
     556            // Special case for episodes of 24.
     557            // -2 from the length cause we don't want ": " on the end
     558            event.subtitle = event.description.mid(position1,
     559                                tmp24ep.cap(0).length() - 2);
     560            event.description = event.description.remove(tmp24ep.cap(0));
     561        }
     562        else if ((position1 = event.description.find(m_ukTime)) == -1)
     563        {
     564            if (!isMovie && (event.title.find(m_ukYearColon) < 0))
     565            {
     566                if (((position1 = event.title.find(":")) != -1) &&
     567                    (event.description.find(":") < 0 ))
     568                {
     569                    if (event.title.mid(position1+1).find(m_ukCompleteDots)==0)
     570                    {
     571                        SetUKSubtitle(event);
     572                        QString strTmp = event.title.mid(position1+1);
     573                        event.title.setLength(position1);
     574                        event.subtitle = strTmp+event.subtitle;
     575                    }
     576                    else if ((uint)position1 < SUBTITLE_MAX_LEN)
     577                    {
     578                        event.subtitle = event.title.mid(position1 + 1);
     579                        event.title = event.title.left(position1);
     580                    }
     581                }
     582                else
     583                    SetUKSubtitle(event);
     584            }
     585        }
     586    }
    575587
    576         // We remove [AD,S] from the subtitle.
    577         QString stmp = event.subtitle;
    578         int     itmp = position1 + tmpUKCC.cap(0).length();
    579         event.subtitle = stmp.left(position1) + stmp.mid(itmp);
     588    if (!isMovie && event.subtitle.isEmpty())
     589    {
     590        if ((position1=event.description.find(m_ukTime)) != -1)
     591        {
     592            position2 = event.description.find(m_ukColonPeriod);
     593            if ((position2>=0) && (position2 < (position1-2)))
     594                SetUKSubtitle(event);
     595        }
     596        else if ((position1=event.title.find("-")) != -1)
     597        {
     598            if ((uint)position1 < SUBTITLE_MAX_LEN)
     599            {
     600                event.subtitle = event.title.mid(position1 + 1);
     601                event.subtitle.remove(m_ukSpaceColonStart);
     602                event.title = event.title.left(position1);
     603            }
     604        }
     605        else
     606            SetUKSubtitle(event);
    580607    }
    581 
     608 
    582609    // Work out the year (if any)
    583610    QRegExp tmpUKYear = m_ukYear;
    584611    if ((position1 = tmpUKYear.search(event.description)) != -1)
     
    593620            event.originalairdate = QDate(y, 1, 1);
    594621    }
    595622
    596     // Trim trailing '.'
    597     event.title.remove(m_ukPEnd);
    598     event.subtitle.remove(m_ukPEnd);
     623    // Trim leading/trailing '.'
    599624    event.subtitle.remove(m_ukDotSpaceStart);
     625    if (event.subtitle.findRev("..") != (((int)event.subtitle.length())-2))
     626        event.subtitle.remove(m_ukDotEnd);
     627
     628    // Reverse the subtitle and empty description
     629    if (event.description.isEmpty() && !event.subtitle.isEmpty())
     630    {
     631        event.description=event.subtitle;
     632        event.subtitle=QString::null;
     633    }
    600634}
    601635
    602636/** \fn EITFixUp::FixPBS(DBEvent&) const
  • libs/libmythtv/eitfixup.h

     
    1717  protected:
    1818     // max length of subtitle field in db.
    1919     static const uint SUBTITLE_MAX_LEN = 128;
     20     // max number of words included in a subtitle
     21     static const uint kMaxToTitle = 14;
    2022     // max number of words up to a period, question mark
    21      static const uint kDotToTitle = 8;
     23     static const uint kDotToTitle = 9;
     24     // max number of question/exclamation marks
     25     static const uint kMaxQuestionExclamation = 2;
     26     // max number of difference in words between a period and a colon
     27     static const uint kMaxDotToColon = 5;
    2228
    2329  public:
    2430    enum FixUpType
     
    7985    const QRegExp m_bellPPVDescriptionAllDay;
    8086    const QRegExp m_bellPPVDescriptionAllDay2;
    8187    const QRegExp m_bellPPVDescriptionEventId;
    82     const QRegExp m_ukSubtitle;
     88
    8389    const QRegExp m_ukThen;
    8490    const QRegExp m_ukNew;
    85     const QRegExp m_ukT4;
    86     const QRegExp m_ukEQ;
    87     const QRegExp m_ukEPQ;
    88     const QRegExp m_ukPStart;
    89     const QRegExp m_ukPEnd;
     91    const QRegExp m_ukCEPQ;
     92    const QRegExp m_ukColonPeriod;
     93    const QRegExp m_ukDotSpaceStart;
     94    const QRegExp m_ukDotEnd;
     95    const QRegExp m_ukSpaceColonStart;
     96    const QRegExp m_ukSpaceStart;
    9097    const QRegExp m_ukSeries1;
    9198    const QRegExp m_ukSeries2;
    9299    const QRegExp m_ukSeries3;
    93100    const QRegExp m_ukCC;
    94101    const QRegExp m_ukYear;
    95102    const QRegExp m_uk24ep;
    96     const QRegExp m_ukStarring;
     103    const QRegExp m_ukStarring2;
    97104    const QRegExp m_ukBBC7rpt;
    98     const QRegExp m_ukCBBC;
    99     const QRegExp m_ukCBeebies;
    100     const QRegExp m_ukStarring1;
     105    const QRegExp m_ukDescriptionRemove;
     106    const QRegExp m_ukTitleRemove;
    101107    const QRegExp m_ukDoubleDotEnd;
    102108    const QRegExp m_ukDoubleDotStart;
    103     const QRegExp m_ukDotSpaceStart;
    104109    const QRegExp m_ukTime;
    105110    const QRegExp m_ukBBC34;
    106     const QRegExp m_ukBBCSwitch;
    107111    const QRegExp m_ukYearColon;
     112    const QRegExp m_ukExclusionFromSubtitle;
     113    const QRegExp m_ukCompleteDots;
     114
    108115    const QRegExp m_comHemCountry;
    109116    const QRegExp m_comHemDirector;
    110117    const QRegExp m_comHemActor;