Reply to post

Hot![FAQ]Use custom speech replacement with specific articles, read lists or web origin articles

Author
Admin
Administrator
  • Total Posts : 275
  • Reward points: 0
  • Joined: 2010/11/22 00:00:00
  • Location: USA
  • Status: offline
2016/09/24 08:20:51 (permalink)

Use custom speech replacement with specific articles, read lists or web origin articles

There is a way in @Voice to use custom speech filters for different files, directories etc. – therefore also for the lists, if you save each list articles in a different folder… It can be done with @Voice filters feature. Here is an example if you have e.g. a specialized speech filter for medical terminology: create a file named something.json, e.g. medical.json, inside the Filters sub-folder of the main @Voice folder. Inside that file put the following text:
 
{
  "extractor": "default",
  "file": ".*/medical/.*",
  "title": "Medical terms speech filter",
  "speechFilt": "medical-replace-eng.txt"
}
 
Also create and place in the same Filters folder, a speech replacement files named medical-replace-eng.txt. Put all your files from the “medical” reading list into a sub-folder named medical, and you’re all set… Let me know if this works for you.
 
The “file” field is a RegEx expression for a file name, so instead of putting your articles into a specified folder, you could add something unique to the file name for example. But more importantly, instead of “file”, you could use “url” field and use the specific filter for all articles from any web site matching the URL address RegEx. Here is an example of a more complex filter that does it:
 
{
  "extractor": "full",
  "disabled": false,
  "url": "http://(www\\.orthobullets\\.com/)|(www\\.medbullets\\.com/)",
  "title": "Orthobullets - educational resource for orthopaedic surgeons",
  "speechFilt": "orthobullets-replace-eng.txt",
  "nodeAdd": [
    { "tag": "h1", "attrib": [{ "name": "id", "val": "ctl00_content_lblTopicTitle" }]},
    { "tag": "div", "attrib": [{ "name": "id", "val": "topic-content" }]},
    { "tag": "h2""attrib": [{ "name": "id", "val": "ctl00_content_qbankTitle" }]},
    { "tag": "div", "attrib": [{ "name": "class", "val": "topicquestion" }]}
  ],
  "nodeRemove": [
    { "tag": "h2", "attrib": [{ "name": "class", "val": "i_inline" }]},
    { "tag": "div", "attrib": [{ "name": "id", "val": "allComments|responseMessage|ctl\\d+_content_rptQuestions_ctl\\d+_QuestionItem1_Div12" }]},
    { "tag": "div", "attrib": [{ "name": "style", "val": ".*border: 1px.*" }]},
    { "tag": "div", "text": "^[\\s]*TAG[\\s]*$" },
    { "tag": "div", "attrib": [{ "name": "class", "val": "figures_place" }]},
    { "tag": "a", "attrib": [{ "name": "id", "val": "ctl\\d+_content_rptQuestions_ctl\\d+_QuestionItem1_A1" }]}
  ],
  "edit": [
    { "repeat": true, "from": "\\(OBQ\\d+\\.\\d+\\)", "subst": "(Question [q:1:1])" }
  ]
}
 
This filter does also customized content extraction with “nodeAdd” and “nodeRemove” fields, and some content editing in the extracted text, but if you don’t need it, just use this part:
 
{
  "extractor": "default",
  "url": "http://(www\\.orthobullets\\.com/)|(www\\.medbullets\\.com/)",
  "title": "Orthobullets - educational resource for orthopaedic surgeons",
  "speechFilt": "orthobullets-replace-eng.txt"
}
 
Greg
post edited by Admin - 2017/02/07 19:47:39

7 Replies Related Threads

    david.dupont
    User
    • Total Posts : 20
    • Reward points: 0
    • Joined: 2015/04/10 03:37:04
    • Status: offline
    Re: Use custom speech replacement with specific articles, read lists or web origin article 2016/09/26 03:08:09 (permalink)
    Thnkas Greg
    I will test that.
     
    With this it could be more more easy to share replace.txt with other users.
    Kate
    User
    • Total Posts : 0
    • Reward points: 0
    • Joined: 2018/08/28 08:16:37
    • Status: offline
    Re: Use custom speech replacement with specific articles, read lists or web origin article 2018/09/01 08:37:03 (permalink)
    Hope it will be useful to me, thanks!
    Sorawut
    User
    • Total Posts : 0
    • Reward points: 0
    • Joined: 2019/01/21 07:50:55
    • Status: offline
    Re: Use custom speech replacement with specific articles, read lists or web origin article 2019/01/22 02:31:41 (permalink)
    Hi, 
     
    I have tried follow your guide above but it did not work. 

    I have created 2 files below to test.

    File#1 \.config\filters\medical.json

    {
      "extractor""default",
      "url""https://(www\\.orthobullets\\.com/)|(www\\.medbullets\\.com/)",
      "title""Orthobullets - educational resource for orthopaedic surgeons",
      "speechFilt""orthobullets-replace-eng.txt"
    }

    File#2 \.config\filters\orthobullets-replace-eng.txt

    *".+" " Test "
    Admin
    Administrator
    • Total Posts : 275
    • Reward points: 0
    • Joined: 2010/11/22 00:00:00
    • Location: USA
    • Status: offline
    Re: Use custom speech replacement with specific articles, read lists or web origin article 2019/01/22 07:26:31 (permalink)
    I really don't understand what you want to achieve. Are you a medical doctor, studying for exams from orthobullets.com or medbullets.com web sites? What exactly do you want to do? What kind of files you want to filter and how, where are they located or from where they are downloaded?
     
    Greg
    Sorawut
    User
    • Total Posts : 0
    • Reward points: 0
    • Joined: 2019/01/21 07:50:55
    • Status: offline
    Re: Use custom speech replacement with specific articles, read lists or web origin article 2019/01/22 11:44:10 (permalink)
    Ok, let see the real.

    Link
    https://www.facebook.com/...98408/398138307416753/

    File#1 \.config\filters\facebook.json
    {
    "extractor": "full",
    "url": "https://www\\.facebook\\.com/",
    "title": "Facebook",
    "speechFilt": "facebook-replace-tha.txt"
    }

    File#2 \.config\filters\facebook-replace-tha.txt
    *"^(Jump to|Sections of this page|Other pages on Facebook|Accessibility help|Press alt \+ \/ to open this menu|Home|Posts|Photos|Community|Videos|Events|About|Info and ads)$" ""
    Admin
    Administrator
    • Total Posts : 275
    • Reward points: 0
    • Joined: 2010/11/22 00:00:00
    • Location: USA
    • Status: offline
    Re: Use custom speech replacement with specific articles, read lists or web origin article 2019/01/22 17:44:39 (permalink)
    I would have to double check the regex you wrote for correctness, however one thing that needs to be different: the filter files named facebook.json and facebook-replace-tha.txt should be placed in a sub-directory named Filter of the main @Voice app directory, i.e. it would be under a path similar to this:
     
    /sdcard/Android/data/com.hyperionics.avar/files/Filters/facebook.json
    /sdcard/Android/data/com.hyperionics.avar/files/Filters/facebook-replace-tha.txt
     
    the directory under .config/filters is for app use only, the filters there are downloaded from my web site, which I add and update periodically as needed. User filters placed there take no effect.
    post edited by Admin - 2019/01/22 17:47:26
    Sorawut
    User
    • Total Posts : 0
    • Reward points: 0
    • Joined: 2019/01/21 07:50:55
    • Status: offline
    Re: Use custom speech replacement with specific articles, read lists or web origin article 2019/01/22 21:03:53 (permalink)
    Thank you so much, it works now.
     
    I have changed "facebook-replace-tha.txt" to
     
    *"\>(Jump to|Sections of this page|Other pages on Facebook|Accessibility help|Home|YouTube|Videos|Events|Liked|Posts|About|Notes|Reviews|Photos|Groups|Community|Info and ads)<" "><"
    *"Press .+ to open this menu" ""
    post edited by Sorawut - 2019/01/22 22:33:03
    Jump to:
    © 2019 APG vNext Commercial Version 5.1