Elixir East Travel: A simple Chinese sentence parsing

Source: Internet
Author: User

Backup: https://zhuanlan.zhihu.com/p/46030123

Code Address: Github:pyzh/gdpl-ex.poc-1

The original statement is: List1 is ' 12332234 '; note A is list1,b 2; Ask for the number of B in a

The whole process is this:

First the segmentation, and then judge the sentence attributes (this step is actually not strictly implemented in the code)

In the first sentence, because there is only one [for] the word, so you can think that the first sentence is an assignment statement;

And the second sentence has a [remember] the word, this in [Ld2] in the setting, is higher than [for] the priority, so the second sentence is actually [record + for] The definition of the statement;

The third sentence is the [seek] statement, which is calculated based on the previous article (assuming [ask: number] is a member of the standard library)

for [for] and [recorded] differences, in the setting, [for] can only specify a value, and [recorded as] can point to the value, also can point to the parameter (such as A→list1)

In the third sentence, [middle] determines the order of the levels A and B. about [the] word processing, the current LD2 has not been clear specification.

Origin: The count primitive in APL and ABC

Figure 2: Fluent Python python's direct ancestor/abc's count syntax

Reference:

    1. LD2/First draft: A DSL design approach based on Chinese-class SQL · Program-in-chinese/overview #89
    2. Commemoration of "APL" published 50
    3. ABC Quick reference:https://homepages.cwi.nl/~steven/abc/qr.html

Elixir East Travel: A simple Chinese sentence parsing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.