class CustomSorter(object): def __init__(self,alphabet): self.alphabet=alphabet def __call__(self,word1,word2): comp=0 if word1=='' and word2=='': comp=0 elif word1=='': comp=-1 elif word2=='': comp=1 else: head1,tail1=self.separate(word1) head2,tail2=self.separate(word2) if head1==head2: comp=self(tail1,tail2) else: comp=self.alphabet.index(head1)-self.alphabet.index(head2) return comp def separate(self,word): candidates=self.Candidates(word) while candidates==[]: word=word[1:] candidates=self.candidates(word) candidates.sort(key=len) head=candidates.pop() tail=word[len(head):] return head,tail def Candidates(self,word): return [letter for letter in self.alphabet if word.startswith(letter)]
Saturday, 28 July 2012
Custom sorting for conlangs
Thursday, 21 June 2012
Some Original Reasons for Invading Earth
In some SF shows, it seems that Earth can scarcely get through a week without being invaded by aliens. The trouble is, the aliens are running out of reasons to invade. All the usual ones, enslaving the population, plundering the planet's mineral wealth, fleeing your doomed homeworld, converting the planet into a weapon of cosmic destruction, they've all been done. I'd like to suggest some alternatives for interplanetary despots in search of new reasons to invade.
Bragging rightsThe guys back at home will be so jealous when they hear that we conquered Earth.
Turning the planet into a tourist resortBeautiful scenery, fascinating cultures: Buy a SpaceTimeshare ® on Earth today!
Conceptual ArtThis Happening challenges us to explore such themes as: What does it mean to be an alien? and Why do we really invade planets?
Dragées Those little silver coated sugar ballsused for decorating cakes. According to The Doctor, you can only get them on Earth. Have you any idea the price they fetch in Andromeda?
Wednesday, 9 May 2012
Parts of Speech in the Voynich Manuscript
- A cipher for some natural language
- A conlang
- Gibberish
| Cluster | Number of words | Number of instances |
|---|---|---|
| 0 | 4291 | 15790 |
| 1 | 1470 | 7040 |
| 2 | 747 | 3460 |
| 3 | 379 | 2270 |
| 4 | 4420 | 12142 |
Monday, 19 March 2012
The Great Debate
The hall was full of men, each of whom had one eye closed. The first speaker expounded at length that those who opened the right eye saw more clearly, and thus achieved a surer increase in wisdom than those who closed it. Another man replied that there had been a great many wise men throughout history who had opened their left eyes.
Another speaker said that a great many crimes had been committed by those who closed their left eyes. The reply came that some of the most notorious of criminals has been men that closed their right eyes. The first speaker countered that the perversity of such men was due to the fact that, having been trained in their youth to close their left eyes, by the time they closed their right eyes, they drew no benefit.
Another speaker said that those who closed their right eyes were constantly looking backwards over their shoulders, while those opened them looked ahead. His opponent said that those who closed their left eyes were so obsessed with going forwards, they never looked around to see if it was the right way to go.
A man rose to his feet to say that it was necessary to close the right eye, so that the vision of the left should not become clouded with illusions. At this, another jumped up and shouted angrily that to say that the things seen with the right eye were illusions was a wicked lie, and it was more than likely that all the things he claimed to have seen with his left eye were wicked lies too. A younger man then shouted out that the right eye saw nothing at all, and that all who claimed to see through it were merely repeating what others had told them.
Thus the debate continued, becomming more and more heated. But I left the chamber with both eyes open.
Tuesday, 6 March 2012
Downloading "A Game of Thrones" - A British Perspective
I tried to watch Game of Thrones and this is what happened - The Oatmeal
This webcomic has been causing a fair bit of controversy on the Internet recently. Now, I'm all in favour of creators getting paid, and I know somebody who's involved in the production, and certainly deserves his cut, but here in the UK there's another problem. "A Game of Thrones" is broadcast by Sky over here. Sky's owners also own some tabloid newspapers, which are at the centre of a major scandal at the moment. Their journalists have been involved in phone hacking and corrupt payments to police officers on a massive scale. So it looks like, over here, even if you watch the programme legally, you'll still be giving money to a bunch of crooks.
Thursday, 9 February 2012
Captain Zeno Goes Faster Than Light!
We humans don't like the word "impossible", which is why, no matter how unlikely it is that the neutrino anomaly will lead to faster-than-light spaceships, I, for one, have my fingers crossed. Let us imagine, for the sake of an SF thought experiment, that Captain Zeno is on the bridge, ready to begin humanity's first voyage to Delta Pavonis. He's plotted his course as accurately as possible, but over 20 light years, the margin of error is pretty vast. Worse than that, when you're going faster than light, you can't see where you're going. How can he steer?
Fortunately, there's an answer. Halfway there, he stops, checks his position and corrects his course. After half the remaining distance, he does it again, and keeps doing it until he's close enough to Delta Parvonis to go the rest of the way at a normal speed.
I call this Zenonian Navigation, after Zeno of Alexandria, who claimed that motion is impossible, because before you can go anywhere, you first have to get halfwat there, and before you can get halfway there... Probably the most obviously wrong idea in the history of maths.