topics:  main-page   everything   99things   things-to-do   software   space   future   exercise & health   faith  
  thought   web   movies+TV   music   mymusic   food   curiosity   tidbits   I remember   wishlist   misc   links


This section lists all blog posts, regardless of topic.

Exercise 32: Large numbers
November 4, 2008

Summary

Implement a command and control grammar to recognize large numbers so that Grace can be asked things such as "What is five hundred and ninety times forty one"?

Enhance the voice command syntax to support named rules. For example:
number_part: {group_of_ten} {digit}

What this says is that a rule named number_part consists of a group_of_ten token followed by a digit token.

Allow rules to be referenced using the following syntax:
{number_part}

Since this overlaps the syntax used to reference an entity type, we will treat entity types as an implicit rule. If there is a rule that uses the same identifier, it will override the entity type.

Use the large number translations as a basis for the voice command grammar.

Solution

It appears that voice recognition grammar rules can't contain any circular references, so the transformations that I've been using can't be directly adapted. For the time being, I'm using the following:

small_number: [{digit} | {teen_number} | {group_of_ten} | {group_of_ten} {digit}]
number: [{small_number} | {small_number} {multiplier} | {small_number} {multiplier} (and) {small_number}]

The other issue I ran into is that my approach of enumerating all entity type permutations before trying to parse a phrase isn't scalable past about 6 words. I've bumped into it before, but it's a bit more obvious when dealing with numbers since numbers tend to be very wordy.

I think I'll take a crack at trying to rewrite this part of the language parsing algorithm to see whether it is possible to enumerate on the fly. I expect it is, and this approach might make the algorithm scalable up to say 10 words, or it might make it scalable past 15, it's hard to know.


Exercise 31: Music, math, and email queries
November 2, 2008

Implement the following use cases:

1."Play {song_title}", "Play the song {song_title}", and "Play the song {song_title} at {number} percent volume". All of a user's iTunes songs should work. Implement "Pause", "Pause the song", "Resume", "Resume the song".

2."What is X * Y?", "What is X + Y?". For now, only implement math for numbers between 1 and 19 since command and control voice recognition won't recognize larger numbers by default.

3."Ask Meredith when she'll be home". Send a pre-formatted email to Meredith asking her when she'll be home, and use a return email address of "grace.bigham@gmail.com". Check the Gmail account once every minute for a reply. If the email is replied to, speak the response.

Solution

Click here


The American election
November 2, 2008

So, the time has come for America to vote. I feel sort of guilty that as a Canadian I find American elections more interesting on many levels than Canadian ones... but so be it. (The other reason that elections make me feel guilty is that I don't really have a clue. I mean, there are certain policies that I know clearly which way I'd vote, but for the majority of things it's more of a guessing game)

Anyway, blabbering about election guilt aside, it will be interesting to watch this election. Regardless of who wins, we already know the outcome to be interesting:

If the republicans win, the US will have a lady vice president, which will be a pretty significant thing in my mind... and the chance that she would be come president, which is perhaps the more significant thing. In my mind, Sarah Palin is a very likable, hard working, down-to-earth person who wants to serve her country. I would tend to side with those that say she comes across as a bit under experienced to lead the US as president, but I also think that people are blowing that issue out of proportion: She's the governor of Alaska, not the mayor of a small town.

If the democrats win, the US will have a president with a strong African American heritage, which fascinates me. That seems like a tremendous victory for a country that has struggled, and continues to struggle, with racism. Obama seems like a strong, hard working, dynamic person that brings a lot of leadership talent. I especially like his tone when it comes to international affairs, which is the area that I think the US needs the most reform in. Obama seems to be a person that wants to listen rather than to dominate, and I feel the current US policy has been too far on the side of domination.

If I could vote I'd vote for Obama. That's quite possibly how things will play out anyway, but we'll just have to wait and see. I'm a little fearful that Obama will lose and that his loss could cause a rift in the US, especially if there is any sense of unfairness or jiggery-pokery. I'll hope for the best.

older >>