Sublime Forum

Is this possible as a plugin to sublime text?

#1

First of all, I must apologize for any ignorance. I am not a python developer. I’m simply trying to pick the brains of those who know more than me to help me determine the best way forward with a project I envision.

I use sublime to program PHP, and love it. I’m wondering if the plugin/package system is robust enough to make sublime into something it was not intended for, an editor which parses English specifically geared toward the writing of poetry. The general text editor and line numbers are good, but the ability to parse lines of text using dictionaries or the nltk to count syllables, separate words into syllables, lookup dictionary/thesaurus/rhymes then sort these rhymes into metrical feet (ie. iamb, trochee, dactyl, etc.) by comparing them to word lists, is what I’m looking to add. Would something like this be possible in a plugin, or would it require being written as its own application? I’m trying to get some input before I go off the deep end and learn python, or hire a developer, only to find out its not possible. Thank you for any input you can give.

0 Likes

#2

You could add a plugin that could look up words in the current buffer and measure them however. You could also make new buffers and put arbitrary text into them. All in all what you’re saying sounds pretty reasonable.

0 Likes

#3

I was worried about importing outside dependencies like nltk, to look up definitions and separate strings into syllables. ST2 plugins can handle that sort of thing?

0 Likes

#4

You can just drop a folder into your plugin directory and if it has an init.py you can import it.

0 Likes

#5

Thank you very much. I appreciate the answers. Now it’s off to the books.

0 Likes

#6

so, if i’m understanding correctly, I can drop an init.py into a folder to get ST to recognize files in nested folders? For Example, I make a package folder:

MyPackage/ myplugin.py anotherFolder/ __init__.py moreplugins.py anotherplugin.py

Can I get ST to recognize the py files nested within that package folder? I notice that all other packages have a ton of files just shoved in to the top-level directory. This makes things difficult, not only for organization, but for including some of the functionality I’m trying to include. If all files must be top-level in package folders, I’m going to have to make two separate packages that function as one to work the way I’m wanting them to.

0 Likes

#7

Take a look at BracketHighlighter [1] or FavoriteFiles [2]. I think they will help you out.

[1] github.com/facelessuser/BracketHighlighter
[2] github.com/facelessuser/FavoriteFiles

0 Likes

#8

Perfect! Thanks. I can’t promise no more questions, but that answers a lot.

0 Likes