Reply to post

Hot![FAQ]Silencing citations in scientific papers

Author
Admin
Administrator
  • Total Posts : 275
  • Reward points: 0
  • Joined: 2010/11/22 00:00:00
  • Location: USA
  • Status: offline
2017/09/20 19:47:13 (permalink)

Silencing citations in scientific papers

The regular expression (RegEx) given below will make @Voice app skip reading aloud citations in parenthesis often found in scientific papers, formatted similar to these:
(Derwing, Rossiter, & Munro, 2002; Thomas, 2004)

(American Psychological Association, 1993; Arredondo et al., 1996; Council of National Psychological Associations for the Advancement of Ethnic Minorities, 2000; Cross, Bazron, Dennis, & Isaacs, 1989; Dulles Conference Task Force, 1978; C. Hall, 1997; Korman, 1974; Marsella, 1998; President’s Commission on Mental Health, 1978; Ridley, Mendoza, Kanitz, Angermeier, & Zenk, 1994; D W Sue, Arredondo, & McDavis, 1992; D W Sue, Bingham, Porche-Burke, & Vasquez, 1999; D W Sue et al., 1982; D W Sue, Carter, et al., 1998)
Here are instructions on how to create a speech replacement to skip these citations when reading aloud:
 
In @Voice app, press menu (3 vertical dots button top right of screen), press Settings - Edit speech. Press the [+] button on top to create a new speech replacement. Then enter the following:
 
Replace type:   RegEx
Pattern:   
(\([^)]*,\s*\d\d\d\d(\)|(;[^)])*)\))|(\([^)]*,\s*\d\d\d\d(\)|(;[^)]*))$)|(^[^()]*,\s*\d\d\d\d(\)|(;[^)])*)\))|(^\s*\d\d\d\d\))
Replace with:  - leave empty for silence
 
Note - the "Pattern" field content should be all in one line. It is very complex and every character matters, so it would be best to open this page on your Android device in a web browser, copy the "Pattern" content starting from the very first "(" character and up to and including the last ")". Then switch to @Voice app, edit speech and paste this expression into the "Pattern" field.
 
If you want, instead of leaving the "Replace with:" field empty, you can enter there some other text, for example "(citations)". In this case you will hear one word "citations" instead of the long list of names and years of publications.
 
More, background info:
You might ask, why is this expression so long and complex? The “Edit speech” feature in @Voice works within one “sentence” only, or rather a fragment of text that @Voice sends as one piece to TTS engine. These pieces are normally sentences, but sometimes sentence splitting cannot distinguish between a dot after an abbreviation that @Voice app does not know, and a dot ending a sentence. Further, some TTS engines limit the maximum length of text to about 500 characters, so if a sentence is longer, I have to split it.
 
Some citations are longer than 500 characters, so Edit speech cannot handle them well. Still I managed to build the above Regular Expression (RegEx) that matches either a complete citation within one phrase (one yellow highlight in @Voice), or a partial one that is broken off at the end of the phrase, or continues from the previous phrase and ends in the current one. 
 
Of course, if you manage to improve the above RegEx replacement or have better ideas, please share them in this thread by posting below. Happy and productive listening!
 
Greg
post edited by Admin - 2017/09/20 19:53:43

4 Replies Related Threads

    leopoldocosta
    User
    • Total Posts : 0
    • Reward points: 0
    • Joined: 2018/10/26 05:56:15
    • Status: offline
    Re: Silencing citations in scientific papers 2018/10/26 10:02:51 (permalink)
    Desta Greg, can u help me understand why it didnt work for the following text?


    A desobediência da lei de Deus é pecado (I João 3:4; 5:17) e é o que provoca a separação eterna da presença de Deus (Gên. 2:17; Rom. 6:23).




    It keeps reading inside parenthesis
    Admin
    Administrator
    • Total Posts : 275
    • Reward points: 0
    • Joined: 2010/11/22 00:00:00
    • Location: USA
    • Status: offline
    Re: Silencing citations in scientific papers 2018/10/28 10:43:43 (permalink)
    Well, these citations have different format that does not match RegEx created for scientific papers... The following substitution should work for you:
     
    Replace type:   RegEx
    Pattern:   \([^)]*?\d+:\d+\)
    Replace with:  - leave empty for silence
     
     
    Greg
    leopoldocosta
    User
    • Total Posts : 0
    • Reward points: 0
    • Joined: 2018/10/26 05:56:15
    • Status: offline
    Re: Silencing citations in scientific papers 2018/10/28 11:48:09 (permalink)
    Dear Greg,

    Thanks for your reply. I tested it but what happend is that it only removed the text after the semicolon. The ones without semicolon were removed correctly, thank you.

    Can you help with these with semicolon?

    Original:
    A desobediência da lei de Deus é pecado (I João 3:4; 5:17) e é o que provoca a separação eterna da presença de Deus (Gên. 2:17; Rom. 6:23).

    Modified:
    A desobediência da lei de Deus é pecado (I João 3:4; e é o que provoca a separação eterna da presença de Deus (Gên. 2:17;.



    Also, some texts inside parenthesis may or may not have dashes, dots and/or semicolon.


    In my readings, all texts inside parenthesis can be removed without problem.
    post edited by leopoldocosta - 2018/10/28 15:47:55
    Admin
    Administrator
    • Total Posts : 275
    • Reward points: 0
    • Joined: 2010/11/22 00:00:00
    • Location: USA
    • Status: offline
    Re: Silencing citations in scientific papers 2018/11/02 08:39:18 (permalink)
    Sorry about late answer. For me the RegEx expression works fine for the "(I João 3:4; 5:17)" part, so maybe you mis-typed some characters in the "Pattern" field, or added unnecessary spaces in front, at the end or in the middle of expression "\([^)]*?\d+:\d+\)". There are other problems though - @Voice does not recognize "Gên." and "Rom." as valid abbreviations for Portuguese and ends sentences on each dot there. I must think of some other solutions to the problem of abbreviations...
    Jump to:
    © 2018 APG vNext Commercial Version 5.1