topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Sunday December 15, 2024, 5:08 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: [IDEA] Notepad: Highlight all text after X number of characters/words  (Read 11197 times)

vevola

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 104
  • VeVoLa
    • View Profile
    • Donate to Member
You know those fields on websites, where you can enter 2000 characters of text and not more?
I tend to write in notepad or somewhere and then copy/paste into the field, just to find the text having been truncated.

My idea for a Coding snack would be a simple notepad UI, where you specify 1) the number, 2) whether you’re counting words or characters, and 3) if characters include non-space or not. All text beyond that limit will be in red.

The notepad would have tabs for various texts. It would also have backup every x minutes for x number of backups automatically saved.

This would be useful in editing texts down to the proper limit. I know you can check the number count, but this idea is to have a visual representation, where you actually see how many words/chars you’re over as you’re typing, and dwindle your way down til you have no more “red”.

Full disclosure: I'm not a dev, and I had posted this idea as a Notepad+ plugin.
« Last Edit: February 28, 2021, 01:32 AM by vevola »

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: [IDEA] Notepad: Highlight all text after X number of characters/words
« Reply #1 on: February 27, 2021, 09:25 AM »
Nice snack idea @vevola! I'm in with Limitpad! :Thmbsup:
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com
« Last Edit: February 27, 2021, 10:00 AM by publicdomain »

vevola

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 104
  • VeVoLa
    • View Profile
    • Donate to Member
Re: [IDEA] Notepad: Highlight all text after X number of characters/words
« Reply #2 on: February 28, 2021, 01:35 AM »
Nice snack idea @vevola! I'm in with Limitpad! :Thmbsup:

Awesome! Are you thinking of making it a Notepad+ plugin, or a Word macro, or a standalone EXE?
This will def save me (and others) time especially with sending online applications!

KodeZwerg

  • Honorary Member
  • Joined in 2018
  • **
  • Posts: 718
    • View Profile
    • Donate to Member
Re: [IDEA] Notepad: Highlight all text after X number of characters/words
« Reply #3 on: February 28, 2021, 06:58 AM »
For training purposes I quickly programmed my own Editor for such purpose.

Counting characters was easiest part.

Counting words bring me many troubles.

What is a word?

My problem for now is 'how to make differences between real words and no words that are between spaces/quotes/point or comma terminated etc etc etc'

My buggy examples where I do not have a real good solution yet.

A) 
A.
$ 1.99
(Text)
Text&Text
"Text(text)_text"
[email protected]
88÷2=99.99
123.456,789
Text^2
Word's
0x0A 0F B0
(Ascii Emojis at all)
(Unicode stuff at all eg arabian)

And many more of such stuff.
Without any rules it is hard to define how to detect whats a word and whats not, and how words are counted correct.

No worry @vic, I do not interfere and wont publish my binary, can't await how you solve such problems, great stuff what I've seen so far!  :Thmbsup:

vevola

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 104
  • VeVoLa
    • View Profile
    • Donate to Member
Re: [IDEA] Notepad: Highlight all text after X number of characters/words
« Reply #4 on: February 28, 2021, 07:26 AM »
what is a word?

I would make it simple:
a "word" for this project's purpose is defined an any string of consecutive characters (alphanumeric, punctuation and special characters, anything) separated by a SPACE, LINE or PARAGRAPH SEPARATOR (not including non-breaking spaces).

So
$ 1.99
counts as two "words"
whereas
$1.99
counts as one.


EDIT: https://wordcounter.net/ would agree with this definition!

Here is a links (with more linked text inside) if you want to geek out more: :)
https://en.wikipedia...ations_of_definition

Maybe it would be smart to use the above as a default, and add a "Customize word breaks" setting, if people want to include dashes, slashes or whatever as word boundaries...
« Last Edit: February 28, 2021, 07:39 AM by vevola »

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: [IDEA] Notepad: Highlight all text after X number of characters/words
« Reply #5 on: February 28, 2021, 07:51 AM »
My problem for now is 'how to make differences between real words and no words that are between spaces/quotes/point or comma terminated etc etc etc'

I'd replace all CR's and LF's with a space, then reduce any duplicate spaces to single space, trim leading and trailing spaces off and use one of these solutions (Depending on Delphi version used) to split the string into an array, then get the length of that array/list for the number of words.

KodeZwerg

  • Honorary Member
  • Joined in 2018
  • **
  • Posts: 718
    • View Profile
    • Donate to Member
Re: [IDEA] Notepad: Highlight all text after X number of characters/words
« Reply #6 on: February 28, 2021, 08:05 AM »
I do technical agree for such simplified seperation.

Programming language independent.

I was not clear enough with my examples.

Like "$ 1.99"
I examine char by char to get proper results.
"$" is a symbol, symbol count + 1
"1" is a number, check for more
"." reached seperator, due prior number check for more
"9" and "9" are a number, due prior number make a value out of it, so value counter + 1

That is all okay, problem begin when I do examine such
"Meet at 9.7 People join."
The 9.7 aint a value, its two values.

So your rule is okay for your needs  :Thmbsup:
For my training I do more and hassle around with it  :D

Thanks for your suggestion and links!  :-*
« Last Edit: February 28, 2021, 08:11 AM by KodeZwerg »

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: [IDEA] Notepad: Highlight all text after X number of characters/words
« Reply #7 on: February 28, 2021, 09:33 AM »
The 9.7 aint a value, its two values.
That is dependent on the current Locale. For US locale it is a single number (with fraction) for DE/NL it's an invalid number (thousands separator but not long enough) or two numbers.

According to the specs, defined by vevola, it's better to only use space as a separator, and not care about letters, digits or special characters.

KodeZwerg

  • Honorary Member
  • Joined in 2018
  • **
  • Posts: 718
    • View Profile
    • Donate to Member
Re: [IDEA] Notepad: Highlight all text after X number of characters/words
« Reply #8 on: February 28, 2021, 10:44 AM »
The 9.7 aint a value, its two values.
That is dependent on the current Locale. For US locale it is a single number (with fraction) for DE/NL it's an invalid number (thousands separator but not long enough) or two numbers.

Good point @Ath  :Thmbsup:, I do just not full agree. Sorry me.
Phrase was "meet at 9.7 ppl join"
You see, the dot seperates two sentences and is not meant as fraction seperator in that phrase.
I am aware what you mean with locale settings but that was not my intention, i do think international, my code also :p

Okay you wrote "or two numbers" and that is what i try to specify by code. Brain-cracker ^^

Atm i made it easy for myself by letting user jump through all found values with "use for all" switch.


Anyway, vic has now vevolas rule what simplify everything.

Excuse me for using this thread for my personal issue.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: [IDEA] Notepad: Highlight all text after X number of characters/words
« Reply #9 on: February 28, 2021, 12:19 PM »
Phrase was "meet at 9.7 ppl join"
You see, the dot seperates two sentences and is not meant as fraction seperator in that phrase.
That is a syntax error. After the period should either be a space or a new-line.
That's one of thre reasons I wrote:
replace all CR's and LF's with a space,
:)

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: [IDEA] Notepad: Highlight all text after X number of characters/words
« Reply #10 on: February 28, 2021, 11:23 PM »
No worry @vic, I do not interfere and wont publish my binary

Feel free to publish yours! We're doing this for the users & the more choice for users = the merrier!! :)

can't await how you solve such problems, great stuff what I've seen so far!  :Thmbsup:

Thanks for your heart-warming words :-*

Appreciated.
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com
« Last Edit: March 01, 2021, 02:38 PM by publicdomain »

vevola

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 104
  • VeVoLa
    • View Profile
    • Donate to Member
That is a syntax error.
I totally agree. It's just not a well-formed text.

Phrase was "meet at 9.7 ppl join"
You see, the dot seperates two sentences and is not meant as fraction seperator in that phrase.

Don't confuse what makes sense in the real world and what is meaningful computationally! :)

----

Since LimitPad is meant to be a stand-alone plain text processor of sorts, helpful especially for online forms that require limited text, I have a few more ideas (dunno how you feel about them)!

1. I realize that some forms also have a minimum requirement (e.g., there has to be a minimum 150 chars for example before the form is accepted).

Since the solution for extra text would be to change the font color to red, I was thinking of how to visualize "still missing text". The only thing that I can think of is to change the bgcolor to a light red for the first n-defined chars spaces (which disappears when text is inputted).
What do you think? Maybe you or someone can think of a more elegant solution...

2. Along this line of reasoning, in the original case of maximum limit of n chars, it might be nice to have an option to see the available space even when nothing is there, something like seeing where the limit it by having the n+1 space bgcolor as light red.
This way I know how much space I still have to type. All text after that point becomes red (or you could keep it black with the light red bgcolor).


I'm quite excited about this project! I think it'll be quite useful! I know a lot of online websites where you have to insert feedback or upload information in text fields, so this will be useful! Most of them have character limits, so it's great you're focusing on that, and having word limits as an ulterior option is great!


I was thinking of future development (yes! even before you've published this!) Another idea for LimitPad is to include a minimal UI which resembles traditional wordpad (Think: Plain Text Wordpad!). I don't think this is high priority, but just to think about if you want to make it more aesthetically appealing/more marketable (I'm thinking something as easy as this: https://www.pongores...little-less-ugly.cfm)!

Some minimal pseudo-formatting can happen with plain text (like what I'm doing below!), for example you could select the text or place in the document and via icons in the menu bar create:
- lists can be created with an asterisk or a dash and a space
- indent would be three spaces
- BOLD is all-caps
- you could insert horizontal "line" dividers with symbols like overlines or tildes
- If you define characters per line, you can have left/center/right justification
- You could eventually even add a spell-check
- etc.

There are lots of ways to create visual formatting even of plain text, or even to manipulate (convert case, upside-down text, and other more gimmicky stuff). But like I said, I would rather have a good release version of the base program first, and these are all things you could think about if you want to continue development!

I hope @publicdomain you're as excited as I am! Thanks again for your time and effort!!
« Last Edit: March 01, 2021, 10:03 AM by vevola »

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Awesome! Are you thinking of making it a Notepad+ plugin, or a Word macro, or a standalone EXE?

...And the winner is... a traditional standalone EXE:

Screenshot at 2021-03-01 16-48-41_Limitpad-ALPHA.png

There are lots of ways to create visual formatting even of plain text, or even to manipulate (convert case, upside-down text, and other more gimmicky stuff). But like I said, I would rather have a good release version of the base program first, and these are all things you could think about if you want to continue development!

Agreed! Let's focus on your first request, then expand the base program to suit your ideas :)

I hope @publicdomain you're as excited as I am! Thanks again for your time and effort!!

I'm always happy to help a fellow! :Thmbsup:

BTW Feel free to call me Vic! We're just a few days from v0.1.0. As you are responsive, we can advance the proggie faster.

Cheers!
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com
« Last Edit: March 01, 2021, 04:22 PM by publicdomain »

Target

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 1,832
    • View Profile
    • Donate to Member
rather than placing an arbitrary limit on the number of characters or words, why not use large(?) counters? 

IE you can count the number of words AND characters as you type, and displaying that in a couple of prominent text boxes should be pretty trivial.  This would get you around having to supply a nominal limit, and it would work for both minimum and maximum character limitations without the need to change anything.

And I'm not sure that replacing double spaces is a valid approach.  White spaces are still counted as valid characters so trimming them will skew your results, at least for character counts

vevola

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 104
  • VeVoLa
    • View Profile
    • Donate to Member
We're just a few days from v0.1.0.
-publicdomain (March 01, 2021, 01:36 PM)
Awesome! Will be looking forward to playing around with it! Thanks, Vic!

KodeZwerg

  • Honorary Member
  • Joined in 2018
  • **
  • Posts: 718
    • View Profile
    • Donate to Member
Hey Vic!
Another little Idea that I implemented in my stupid/crazy edition is a password generator.
Many sites have a min/max lenght requirement for such.
Limitpad should have it aswell :)
I do choose by selectable sets (a..z, A..Z, 1..0, special chars) to generate random stuff.
In future versions you might add that.

Examining your image (looks well designed/quick reachable options) i do wonder what button PREV/POST will do.
Cool idea to have many edits within one app!
(Will tab names be modifyable for better seperation? You hopefully do autosave them to prevent loss on crash/quit.)

My app looks and works more like from mobile the sms editor, even if i never met a site that relies on number of words. I just switched to RTF format to be able to colorize text red.

I do agree @Target, never modify input. For word counting trim in memory however you like. When i type 10 spaces, i want to have them.
This could be a seperate option but in no way as default behavior.

For now i am excited as vevola is.
Thank you also for not being mad if i would upload my conversion of that idea.
You accepted first, that i do respect.

Cheers

vevola

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 104
  • VeVoLa
    • View Profile
    • Donate to Member
Will tab names be modifyable for better seperation? You hopefully do autosave them to prevent loss on crash/quit.

I agree. I like the idea that you don't have to name them for them to be saved: an autogenerated name gets assigned and each file is autosaved every predefined N minutes, or they can be saved with name.

Thanks to both of you!

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Hey Vic!
...a password generator.

Sure thing! I have code for arbitrary-length passwords somewhere :up:

i do wonder what button PREV/POST will do.

They're color pickers!

(For coloring text previous and posterior to the set limit, to suit user preference)

Awesome! Will be looking forward to playing around with it! Thanks, Vic!

My pleasure! :)

Finally freed time to engage in a PD coding spree. Chances are v0.1.0 sees the light on the weekend.

Cheers! :Thmbsup:
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com
« Last Edit: March 05, 2021, 09:05 AM by publicdomain »

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,778
    • View Profile
    • Read more about this member.
    • Donate to Member
While thinking about this, I realized this is something Twitter does already:

Tweeter.png

Just a random, not-very-helpful observation from a twit, I suppose. :D

vevola

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 104
  • VeVoLa
    • View Profile
    • Donate to Member
While thinking about this, I realized this is something Twitter does already:

[ Invalid Attachment ]

Just a random, not-very-helpful observation from a twit, I suppose. :D

Not at all! I'm sure some other variations of this idea are out there! Useful to see how others tackle the problem.


publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
While thinking about this, I realized this is something Twitter does already:

Nice observation! :)  I actually like the background highlighting pretty much (chances are it gets added as an option into v0.2+ )  :Thmbsup:

Useful to see how others tackle the problem.

Indeed!

I'm trying to get this baby released yet "regular work" always takes me from the truly important things in life... life enjoying community coding :-*

Given things stay consistent, I'm freed & back to online coding on Thursday.

BTW I still aim at making a living helping others thrive, so let's not discard "traditional work" ends in 2021 for me :Thmbsup: :Thmbsup: :Thmbsup: I'm doing my share of community coding toward Patreon as well as other activities so I  can again focus on my original project of becoming a community coder & online creator.  Knock on wood. May 2021 be the year of the transition!!!

Cheers!

Vic
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com

vevola

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 104
  • VeVoLa
    • View Profile
    • Donate to Member
Given things stay consistent, I'm freed & back to online coding on Thursday.
-publicdomain (March 15, 2021, 11:21 AM)

Hi Vic! Just checking in, since we haven't heard from you this past month. Hopefully all is well on your side - send us a signal of life!

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Hi Vic! Just checking in, since we haven't heard from you this past month. Hopefully all is well on your side - send us a signal of life!

Alive & well here :) Limitpad's actually the very next release! :Thmbsup:

Cheers &

My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
My idea for a Coding snack would be a simple notepad UI, where you specify 1) the number, 2) whether you’re counting words or characters, and 3) if characters include non-space or not. All text beyond that limit will be in red.

Hello @VeVoLa! Just wanted a bit of clarification on #3. Please elaborate!

P.S: the "Count spaces" functionality was deferred for second version... Should it be "Count non-spaces"?

P.P.S. initial version is launching without #3, so take it easy :) it's v0.1.0 --the whole v0.x branch is for this :)
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com
« Last Edit: April 20, 2021, 01:10 AM by publicdomain »

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com