4 ms·
S-expressions are less of a grammar. (send-to (account-of "John") money) has a tree structure that is known even if those symbols have no assigned meaning or le
by kazinator 9y ago
S-expressions are less of a grammar. (send-to (account-of "John") money) has a tree structure that is known even if those symbols have no assigned meaning or lexical category. We know that structure by following just the tiny grammar that governs the parentheses and symbols, instead of the huge (and not completely knowable) grammar which governs sentences like "send the money to John's account".
Linguists do in fact use parenthesized notation ("labelled brackets")
http://www.glottopedia.org/index.php/Labeled_bracketing http://www.glottopedia.org/index.php/Labeled_bracketing
This indicates what the syntax is of a sentence, so that parsing according to a grammar is no longer necessary.
- int_19h 9y agoRight, so parenthesized notation is basically an "AST dump" of a natural language sentence. But when it's dumped to paper, the end result is a visual representation, which still needs to be parsed to consume again (and have the AST inside your brain) - you just have to do it according to the rules of that parenthesized notation. So, when you see a sentence in this notation, do you find that it takes you less time to read than the original notation, or more? For me, it's definitely more. And I think the reason why this is widely used in linguistics is not because it's faster, but because 1) different languages have different syntax parsing rules, and having a single language-agnostic uniform notation is desirable, and 2) unlike normal syntax, this notation is completely unambiguous even in corner cases - in particular, it can explicitly represent arbitrary nesting without ambiguity in a way that commas do not.