Search from various English teachers...
China flagBill Zhou(周军)
the Interesting Work in My Job Today I'd like to introduce what I have been doing in my job. For many people software development is an interesing job and the developers are a group of intelligent people. Actually, it is not as difficult as expected. It just need that you think normally and you don't need to be a talent. My work runs around a SQL (Structured Query Language) language parser, which accepts a string containing a SQL sentence and parses it into a tree with many grammar nodes. I need add processing logics on these nodes. For example, if the sentence is "I am a boy", it will be parsed as a tree with a tree like below: Root Node(Sentence) / | \ ( I) (am) (a boy) Subject node Action Node Object node / \ a boy (Artical Node) (Noun node) To generate such a parsing tree, you need a parser first. You don't need write a parser by yourself since there are many free and open sourced parser generators. The one that I use is Antler, which was invented by a computer professor in an US university. The Antler tool let you create your own language parser and you just provide your grammar file complying with the writing rules. For instance, you write the following grammar file. Sentence: Subject Action Object ; Subject: Noun ; Action: Verb ; Object: Article? Noun ; Noun: 'I' | 'He' | 'She' | 'boy' ; Verb: 'am‘ ; Article: a | A | the | The ; ......... With above grammar file, Antler compiles it and generates a parser for this specific language. "I am a boy" will be a valid sentence and parsed successfully.

Corrections · 5

0
The writing is too long. So I have to paste the rest part as comments.
0
=======================
0
Till now, I guess you should understand my work basically. What I do is to add these specific processing on all nodes I am interested in. SQL grammar is a complex language structure, the document is even several thousand pages. So, you don't worry that you work is finished in a short time.
0
The generated parser provides places indeed to let you do it. You just overrides the default node visiting functions.
0
Though it is really convenient to create the parser automatically, It is useless if the parser cannot give you chance to process the nodes you are interested in. For example, you want to know the action in the sentence and do something for different actions accordingly. If the action is 'buy', you will search what is bought in the rest part in the sentence.

Want to progress faster?

Join this learning community and try out free exercises!

Don’t miss out on the opportunity to learn a language from the comfort of your own home. Browse our selection of experienced language tutors and enroll in your first lesson now!

Start Learning Today