Words Two Words

0 views
Skip to first unread message

Keri Gamrath

unread,
Aug 4, 2024, 10:36:12 PM8/4/24
to upwivasu
Ive long been inspired by an idea I first learned about in The Artist's Way called morning pages. Morning pages are three pages of writing done every day, typically encouraged to be in "long hand", typically done in the morning, that can be about anything and everything that comes into your head. It's about getting it all out of your head, and is not supposed to be edited or censored in any way. The idea is that if you can get in the habit of writing three pages a day, that it will help clear your mind and get the ideas flowing for the rest of the day. Unlike many of the other exercises in that book, I found that this one actually worked and was really really useful.

I've used the exercise as a great way to think out loud without having to worry about half-formed ideas, random tangents, private stuff, and all the other things in our heads that we often filter out before ever voicing them or writing about them. It's a daily brain dump. Over time, I've found that it's also very helpful as a tool to get thoughts going that have become stuck, or to help get to the bottom of a rotten mood.


In the past, looking for a spare notebook was probably easier than looking for a computer. Not anymore. I don't know if my hands even work anymore with pen and paper for any task that takes longer than signing a check or credit card receipt.


I've tried writing my 750 words a day on Livejournal, Wordpress, PBWorks, Tumblr, and all of these other sites designed around putting content online. It hasn't worked for me. I fear that I might accidentally forget to mark daily pages as private. And it's just weird having my private brain dumps out on various sites that are designed to be more social. I don't need to title my entries, or tag them, or enable comments, or any of that other stuff. This is writing, and it's online, but it's not blogging, or Twittering, or Facebook status updating. This is between you and you.


I looked this up. 250 words per page is considered to be the standard accepted number of words per page. So, three standard pages are about 750 words. Of course if 750words.com hadn't been available, I would've totally found a way to prove that 249 words per page was the accepted standard. It really just comes down to the fact that this amount of writing feels about right. You can't just fart out 3 pages without running into your subconscious a little bit... 750 words takes a bit of effort, and it never fails to get me typing things that I have wanted to articulate without realizing it. And that's the point.


Because 750 words is nothing to sneeze at, it's also nice to have an easy way to know how many words you have to go. This site of course tracks your word count at all times and lets you know when you've passed the blessed 750 mark. And it gives you a nice big screen to write on, automatically scrolls as you write (like a typewriter), and automatically saves your writing as you go.


Every month you get a clean slate. If you write anything at all, you get 1 point. If you write 750 words or more, you get 2 points. If you write two, three or more days in a row, you get even more points. It's fun to try to stay on streaks and the points are a way to play around with that. You can also see how others are doing points-wise if you're at all competitive that way. How I see it, points can motivate early on, and eventually the joy of writing will kick in and you'll be writing without any external motivation at all.


Split string by the occurrences of pattern. If capturing parentheses are used in pattern, then the text of all groups in the pattern are also returned as part of the resulting list. If maxsplit is nonzero, at most maxsplit splits occur, and the remainder of the string is returned as the final element of the list. (Incompatibility note: in the original Python 1.5 release, maxsplit was ignored. This has been fixed in later releases.)


string.translate is implemented in C and unlike many string manipulation functions in Python, string.translate does not produce a new string. So it's about as fast as you can get for string substitution.


It's a bit awkward, though, as it needs a translation table in order to do this magic. You can make a translation table with the maketrans() convenience function. The objective here is to translate all unwanted characters to spaces. A one-for-one substitute. Again, no new data is produced. So this is fast!


Next, we use good old split(). split() by default will operate on all whitespace characters, grouping them together for the split. The result will be the list of words that you want. And this approach is almost 4x faster than re.findall()!


First, I want to agree with others that the regex or str.translate(...) based solutions are most performant. For my use case the performance of this function wasn't significant, so I wanted to add ideas that I considered with that criteria.


My main goal was to generalize ideas from some of the other answers into one solution that could work for strings containing more than just regex words (i.e., blacklisting the explicit subset of punctuation characters vs whitelisting word characters).


It would have been nice to be able to map the str.replace to the string instead, but I don't think it can be done with immutable strings, and while mapping against a list of characters would work, running every replacement against every character sounds excessive. (Edit: See next option for a functional example.)


This is what in Haskell is known as the List monad. The idea behind the monad is that once "in the monad" you "stay in the monad" until something takes you out. For example in Haskell, say you map the python range(n) -> [1,2,...,n] function over a List. If the result is a List, it will be append to the List in-place, so you'd get something like map(range, [3,4,1]) -> [0,1,2,0,1,2,3,0]. This is known as map-append (or mappend, or maybe something like that). The idea here is that you've got this operation you're applying (splitting on a token), and whenever you do that, you join the result into the list.


groupby gets our string and function. It splits string in groups using that function: whenever a value of function changes - a new group is generated. So, sep.__contains__ is exactly what we need.


groupby returns a sequence of pairs, where pair[0] is a result of our function and pair[1] is a group. Using 'if not k' we filter out groups with separators (because a result of sep.__contains__ is True on separators). Well, that's all - now we have a sequence of groups where each one is a word (group is actually an iterable so we use join to convert it to string).


This solution is quite general, because it uses a function to separate string (you can split by any condition you need). Also, it doesn't create intermediate strings/lists (you can remove join and the expression will become lazy, since each group is an iterator)


Replace the characters in fromstr with the character in the same position in tostr and delete all characters that are in deletestr. The fromstr and tostr can be empty strings and the deletestr parameter can be omitted.


First of all, I don't think that your intention is to actually use punctuation as delimiters in the split functions. Your description suggests that you simply want to eliminate punctuation from the resultant strings.


I like pprzemek's solution because it does not assume that the delimiters are single characters and it doesn't try to leverage a regex (which would not work well if the number of separators got to be crazy long).


I like the replace() way the best. The following procedure changes all separators defined in a string splitlist to the first separator in splitlist and then splits the text on that one separator. It also accounts for if splitlist happens to be an empty string. It returns a list of words, with no empty strings in it.


I'm in a little city in British Columbia; you're probably somewhere else. I wrote this early in the morning, June 20th, 2013; you're reading it at a different time. I wrote this on my laptop; you could be reading this on your phone, a tablet or a desktop.


You and I have been able to connect because I wrote this and you're reading it. That's the web. Despite our different locations, devices, and time-zones we can connect here, on a simple HTML page.


I wrote this in a text editor. It's 6 kB. I didn't need a Content Management System, a graphic designer, or a software developer. There's not much code on this page at all: just simple markup for paragraphs, hierarchy, and emphasis.


I remember teaching my daughter to code HTML when she was 8. The first thing she wrote was a story about a squirrel. She wasn't "writing HTML"; she was sharing something with the world. She couldn't believe that she could write a story on our home computer, and then publish it for the world to see. She didn't care about HTML; she cared about sharing her stories.


Think about all the things you could communicate with a simple page like this. If you're a businessperson, you could sell something. If you're a teacher, you could teach something. If you're an artist, you could show something you've made. And if your words are good, people will read them.


What do you have to say? If you don't know, there's not much use in adding all that other cruft. Just start with one page, with a single focus. Write it and publish it, and then iterate on that. Every time you're about to add something, ask yourself: does this help me communicate better? Will that additional styling, image, or hyperlink give my audience more understanding? If the answer is "no," don't add it.


Transitional words are like bridges between parts of your essay. They are cues that help the reader interpret your ideas. Transitional words or phrases help carry your thoughts forward from one sentence to another and one paragraph to another. Finally, transitional words link sentences and paragraphs together smoothly so that there are no abrupt jumps or breaks between ideas.

3a8082e126
Reply all
Reply to author
Forward
0 new messages