RPTools.net

Discussion and Support

Skip to content

It is currently Tue Dec 12, 2017 7:23 am 






Reply to topic  [ 10 posts ] 

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7964
Location: Bay Area
 Post subject: Spell Checker solutions and coding questions
PostPosted: Thu Aug 24, 2017 2:01 am 
I'm toying with the idea of having a MapTool spellchecker. It would be nice if there was a built in function, but that's not the case.

The Problem: Sentences with extra or missing spaces.
The Idea: Check the sentences for words and spell check remaining text to see if adding or removing a space makes a word.

I just did a little test where I put in a word list (~84000) and search it for a specific word and it was really fast.

Code:
[frame("test"): {
   [H: index = getMacroIndexes("dictionary")]
   [H: result = listFind(getMacroCommand(index),"the")]
   [R: result]
}]


I did it this way to start because it's easy to manipulate the dictionary. I'll benchmark this vs putting it in to a token property and table entry.

My idea is to take a mashed up sentence and put spaces in to it. For example:
Code:
Theceilingofthiscavernouschambervaultstoaheightofsixtyfeet.


In order to do this I will take the first letter and search db for it. If I get a result then I'll check it's rank for commonly used words. I'll then continue to check for longer words until I'm satisfied I have the most correct word and then add a space and go on to next letters. I'll probably have to create some exceptions or adjustments to ranking like for the really short words like A, I, AN... because they're common but the letters that follow probably make up the correct word or I can do a little back tracking if the next letters don't form a word.

So, I'm looking for other possible solutions, suggestions or insight. The reason? Cutting/Pasting from pdfs really screw up some of the text. I'd be even willing to use a 3rd party app if it can accomplish the same thing, but I looked and didn't really see anything.

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3782
Location: MD
 Post subject: Re: Spell Checker solutions and coding questions
PostPosted: Thu Aug 24, 2017 1:36 pm 
You should hook up with Jamz and see if something like this can be built into the editor in his Nerps fork... which, presumably, will eventually make it into the official MT release.

_________________
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9427
Location: Netherlands
 Post subject: Re: Spell Checker solutions and coding questions
PostPosted: Thu Aug 24, 2017 2:17 pm 
silly me, instead of quote I accidentily hit edit... here's my earlier message.

I can see the reason, had the same issue, what would be even more ideal is if you can also create and intelligent 'line' re-constructor. Usually when you copy paste from a pdf all lines are hard linebreak to make a column. These should all be removed and (sometimes) replaced by a space. Then the double linebreaks (usually paragraphs) should be replaced with a single one. I usually do this in notepad++ so you really see how the linebreaks are effecting the text. But would be nice to have it in MT.

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1722
Location: Chicagoland
 Post subject: Re: Spell Checker solutions and coding questions
PostPosted: Fri Aug 25, 2017 2:44 pm 
FYI: IF you wanted, my fork does include sendURL and getURL that you could use to send a payload (like a json or just raw text) and return the results. There probably is an online dictionary that could be used...

I will also check and see if rSyntax has this already which is what I'm using for the macro editor/syntax highlighting/search & replace...

_________________
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7964
Location: Bay Area
 Post subject: Re: Spell Checker solutions and coding questions
PostPosted: Fri Aug 25, 2017 2:55 pm 
Yeah, I may have to check out your build. sendURL and getURL could be a really powerful tool if it's what I think it is.

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1722
Location: Chicagoland
 Post subject: Re: Spell Checker solutions and coding questions
PostPosted: Fri Aug 25, 2017 3:17 pm 
It is and it is....

I use sendURL with a json payload to send XP and other info to my Slack channel via slack webhook ;)

Of course, you could externalize and get all sorts of data from d20pfsrd... and if you do that, let me know! (haven't had the time to make those fancy changes to my framework)

fyi: getURL just gets data from a URL, sendURL does a post but also returns response... You can look at my XP macro for examples on using it. (follow macro to sendToSlack lib function). (I've also used it to retrieve data from files on my google drive thru PHP)

https://drive.google.com/file/d/0B2c01Y ... otQ3M/view

_________________
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3782
Location: MD
 Post subject: Re: Spell Checker solutions and coding questions
PostPosted: Fri Aug 25, 2017 3:26 pm 
JamzTheMan wrote:
my fork does include sendURL and getURL that you could use to send a payload (like a json or just raw text) and return the results.

This sounds like a cool feature. Are there any inherent security risks with this?

_________________
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1722
Location: Chicagoland
 Post subject: Re: Spell Checker solutions and coding questions
PostPosted: Sat Aug 26, 2017 11:16 am 
A rogue macro could spam? But giving the speed at which macro's run and can only run one at a time, I doubt it would be effective...

I've been meaning to add a whitelist/block/prompt for it and haven't had the time yet.

_________________
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork


Top
 Profile  
 
 Offline
Giant
 
Joined: Mon Aug 03, 2015 5:30 pm
Posts: 227
 Post subject: Re: Spell Checker solutions and coding questions
PostPosted: Sat Aug 26, 2017 1:42 pm 
There's always the possibility of a vulnerability in Java, especially when there's a built in version that doesn't update itself. But that would require that the attacker a) Know you're using MapTool, and a version that includes it's own built-in Java, and b) compromise the web site that you're connecting to.

Seems like a pretty low risk to me, unless your players are a leet hackrz.


Top
 Profile  
 
User avatar  Offline
TheBard
 
Joined: Tue Mar 21, 2006 7:26 pm
Posts: 3484
Location: Austin, Tx
 Post subject: Re: Spell Checker solutions and coding questions
PostPosted: Wed Sep 06, 2017 6:55 pm 
I'm a big proponent of moving the send/getURL into MapTool but I'm not sure it will ever happen because of the assumed security risks associated with it. Seems like the whitelist idea would help mitigate some of the concerns and you could build in a throttle to keep from unintentional spamming.

Of course, I'm also a proponent of building a rudimentary web server into MapTool to present maps and chat via browser as well.

_________________
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 10 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman