Reply to post

[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

1 Reply 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.
    Jump to:
    © 2017 APG vNext Commercial Version 5.1