16. 文字構造

英文句子的解釋由文字構造開始。文句剖析先以空白將句子區分成數個單位, 而類似撇號與標點之類的東西讓文句剖析更形複雜: wasBrownRoss' 分別為單獨的項目, 但是 however, 不是 (因為逗點為獨立單位)。

以下文指令串為 J 的句子,可以採用 doexecute 函數 ". 來執行:

   m=: '3 %: y.'
   d=: 'x.%: y.'
   x.=: 4
   y.=: 27 4096

   ". m
3 16

   do=: ". 
   do d
2.27951 8

J 的文字構造 規則在字典的Part I 有說明。此外,當word-formation函數 ;: 應用在指令串形式的句子,會產生一串封裝文字:

   ;: m
+-+--+--+
|3|%:|y.|
+-+--+--+

   words=: ;:
   words d
+--+--+--+
|x.|%:|y.|
+--+--+--+
J 的 rhematic規則即使應用在英文句子的解析上也相當地好:

   words p=: 'Nobly, nobly, Cape St. Vincent'
+-----+-+-----+-+----+---+-------+
|Nobly|,|nobly|,|Cape|St.|Vincent|
+-----+-+-----+-+----+---+-------+

   >words p
Nobly  
,      
nobly  
,      
Cape   
St.    
Vincent


Exercises

16.1   Choose 句子 such as pp=:+//.@(*/) from earlier exercises, enclose m in quotes, and observe effects of word-formation(;:) on m.

16.2   following facility is available under 視窗與麥金塔: Move cursor to 左of a line so that it is separated from line by one or more spaces,與press Ctrl F1 to display individually boxed words 在句子.


下個前個字彙索引主選單