Resource Raw Text Remover

Discussion in 'Translator's Corner' started by LysUltima, Jan 14, 2018.

  1. LysUltima

    LysUltima Riichi! Tsumo! Toitoi! Suuankou!?

    Joined:
    Aug 6, 2017
    Messages:
    2,144
    Likes Received:
    5,554
    Reading List:
    Link
    Here.
    If you translate on one document under/over raw lines, this should be helpful.
    Unless the raws have a line that's more English than Japanese/Chinese/Korean, this should work 100% of the time.

    upload_2018-1-13_21-16-43.png
    upload_2018-1-13_21-17-5.png
     
    Last edited: Jan 14, 2018
  2. Haxagen

    Haxagen Fallen's|Addicted to Gacha

    Joined:
    Dec 4, 2017
    Messages:
    658
    Likes Received:
    12,668
    Reading List:
    Link
    \o/ Thanks for the work, Lys!
    You're putting it here so readers can MTL by themselves while you slack off, aren't you? I approve.
     
  3. LysUltima

    LysUltima Riichi! Tsumo! Toitoi! Suuankou!?

    Joined:
    Aug 6, 2017
    Messages:
    2,144
    Likes Received:
    5,554
    Reading List:
    Link
    <.<
    It's because I don't want to time deleting these things.
    Laziness is all about efficiency.
     
    Haxagen likes this.
  4. Osamaru

    Osamaru 『Shem's Best Pal ✧ Lexi's Ani ✧ Hamster's Keeper』

    Joined:
    Jun 19, 2016
    Messages:
    3,403
    Likes Received:
    34,133
    Reading List:
    Link
    aoiisora and Guan Zhong like this.
  5. LysUltima

    LysUltima Riichi! Tsumo! Toitoi! Suuankou!?

    Joined:
    Aug 6, 2017
    Messages:
    2,144
    Likes Received:
    5,554
    Reading List:
    Link
  6. yuzuki

    yuzuki [sweet night] [plum blossoms]

    Joined:
    Nov 24, 2015
    Messages:
    662
    Likes Received:
    4,875
    Reading List:
    Link
    :blobsweat::blobsweat::blobsweat: I had been working on a version that was integrated in Google Docs since last week too. XD I think we were all working on one ever since @Tony made his.

    View the manual here: https://yuzukicode.blogspot.com/2018/01/google-docs-blobtl-raw-cleaner-add-on.html

    Introduction
    This is a simple Google Docs add-on that will highlight all lines containing non-English text.

    This app works through a whitelist/blacklist strategy. Every character in a line is converted to its UTF-16 code and checked against a whitelist/blacklist. If the character is on the whitelist, all instances of this character are ignored. If the character is on the blacklist, the entire line is marked as "Raw Text". The whitelist takes precedence over the blacklist.

    Currently, the blacklist contains the unicode blocks for hiragana, katakana, hangul syllables, and the unicode block for 20,000 of the most common ideographs used in Chinese and Japanese. The unicode blocks containing East-Asian punctuation/symbols is NOT on the blacklist by default. Here are the exact blacklist contents:
    The whitelist is currently empty.

    To suggest things to be added to the whitelist/blacklist, you can contact me (@yuzuki on NUF). Alternatively, you can get the source code (which is open-source) yourself and run your own version.

    This add-on is still actively being developed, and I'm currently working an in-app menu that will allow you to define your own personal whitelist/blacklist. Suggestions and bug reports are always very welcome.


    Installation:
    Go to BlobTL Raw Cleaner page in Google Docs add-on store (it's free).

    Click the install button and follow the prompts.

    The first time I installed it, an empty google doc popped up. If the installation worked properly, you should see something like this:

    [​IMG]


    You can close this empty doc.

    Usage:
    Go to the google document you are working on.

    Go to the Add-ons section and select the BlobTL Raw Cleaner.

    I recommend choosing Highlight Raw Text first to check what the script will actually delete.


    [​IMG]

    [​IMG]




    If you are satisfied with the selection, you can delete the selection with the [Backspace] or [Delete] key on your keyboard.

    If you accidentally delete things that you did not want to, you can press Ctrl+Z (undo) to undo the option.

    Ignoring lines:
    Suppose you have a line that you don't want the script to delete. For instance, a paragraph that contains a kaomoji or some other weird character that isn't in the typical western character set.

    You can tell the script to ignore a line by putting two hash tags (##) at the beginning of a line.

    Then, the script will ignore that line.

    [​IMG]

    [​IMG]


    Marking lines for the highlighter:
    You may occasionally encounter situations where you want to manually mark lines for highlighting. For example, some lines in the raw may only contain punctuation.

    You can manually mark a line for deletion by placing two percent signs (%%) at the start of the line.

    [​IMG]

    [​IMG]



    Uninstalling:
    Go to Add-ons > Manage add-ons...

    Then click Manage > Remove

    [​IMG]

    [​IMG]

    Change log:
    • 5 - Fixed bug with shift+enter - 2018-01-14 14:49
    • 4 - Added a line repairing utility - 2018-01-14 01:21
    • 3 - Fixed a bug in the selector - 2018-01-13 23:32
    • 2 - Added a raw selector - 2018-01-13 22:50
    • 1 - Initial functional version - 2018-01-10 13:54

    Credits, Source Code, and License:
    The source code for this add-on is freely available here.

    MIT License. Please credit Blob Translations if you modify or redistribute it.

    Special thanks to @Tony for reviewing the add-on and giving comments, and @BlancFrost for testing. Also, this wouldn't exist if @Action didn't request the feature in the first place.

    Finally, you can find similar tools at these following places:
     
    Last edited: Jan 14, 2018
  7. yuzuki

    yuzuki [sweet night] [plum blossoms]

    Joined:
    Nov 24, 2015
    Messages:
    662
    Likes Received:
    4,875
    Reading List:
    Link
    If anybody needs to customize the behavior any further, the source code for the first one I wrote is here:

     
    LysUltima likes this.
  8. LysUltima

    LysUltima Riichi! Tsumo! Toitoi! Suuankou!?

    Joined:
    Aug 6, 2017
    Messages:
    2,144
    Likes Received:
    5,554
    Reading List:
    Link
    Mine is compatible with shift + enter, so I guess that's a plus :)
     
  9. krrizis

    krrizis Runs Ainushi, Read18 & Chaleuria

    Joined:
    Jan 9, 2016
    Messages:
    562
    Likes Received:
    904
    Reading List:
    Link
    Brilliant. I remembered asking about this on Discord. So I'm glad this is now live.
     
  10. Guan Zhong

    Guan Zhong Well-Known Member

    Joined:
    Jan 12, 2017
    Messages:
    801
    Likes Received:
    2,258
    Reading List:
    Link
    lol, OP's did nothing but give me the same text again. Tony's removed the English... = =

    EDIT: Wait no, Tony's split it properly, i just didn't notice the English in the upper box. cool

    Nice, thanks for this!
     
    Last edited: Jan 14, 2018
  11. LysUltima

    LysUltima Riichi! Tsumo! Toitoi! Suuankou!?

    Joined:
    Aug 6, 2017
    Messages:
    2,144
    Likes Received:
    5,554
    Reading List:
    Link
    would you mind giving me the text you inputted that didn't work?
     
  12. Guan Zhong

    Guan Zhong Well-Known Member

    Joined:
    Jan 12, 2017
    Messages:
    801
    Likes Received:
    2,258
    Reading List:
    Link
    Sent a pm.
     
    LysUltima likes this.
  13. LysUltima

    LysUltima Riichi! Tsumo! Toitoi! Suuankou!?

    Joined:
    Aug 6, 2017
    Messages:
    2,144
    Likes Received:
    5,554
    Reading List:
    Link
    Welp, getting the @Guan Zhong's problem with the text I originally used to test it with.

    I must've broken something when I was trying to fix something else...
     
  14. Guan Zhong

    Guan Zhong Well-Known Member

    Joined:
    Jan 12, 2017
    Messages:
    801
    Likes Received:
    2,258
    Reading List:
    Link
    Been there. Bummer. I'll try her again once she's fixed.
     
  15. LysUltima

    LysUltima Riichi! Tsumo! Toitoi! Suuankou!?

    Joined:
    Aug 6, 2017
    Messages:
    2,144
    Likes Received:
    5,554
    Reading List:
    Link
    Fixed
    upload_2018-1-14_5-7-46.png
     
  16. LysUltima

    LysUltima Riichi! Tsumo! Toitoi! Suuankou!?

    Joined:
    Aug 6, 2017
    Messages:
    2,144
    Likes Received:
    5,554
    Reading List:
    Link
    Wow... nice timing?
     
  17. Guan Zhong

    Guan Zhong Well-Known Member

    Joined:
    Jan 12, 2017
    Messages:
    801
    Likes Received:
    2,258
    Reading List:
    Link
    But I'm still getting the same result... hmm..
     

    Attached Files:

  18. LysUltima

    LysUltima Riichi! Tsumo! Toitoi! Suuankou!?

    Joined:
    Aug 6, 2017
    Messages:
    2,144
    Likes Received:
    5,554
    Reading List:
    Link
    It's the same text?
    Perhaps refresh?
     
  19. Guan Zhong

    Guan Zhong Well-Known Member

    Joined:
    Jan 12, 2017
    Messages:
    801
    Likes Received:
    2,258
    Reading List:
    Link
    Ah yeah I guess it was a cache issue. Works now. Thanks!
     
    LysUltima likes this.
  20. Jimminx

    Jimminx Well-Known Member

    Joined:
    Jan 25, 2017
    Messages:
    186
    Likes Received:
    119
    Reading List:
    Link
    Thank you! This thing is AWESOME!!
     
    LysUltima likes this.