From 93f75e97685520cdad3afab0134e2f65e5e211e2 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Tue, 21 Jul 2020 19:48:24 -0400 Subject: =?UTF-8?q?Add=20Insert=20(=CB=9D)=201-modifier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/doc/group.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/doc/group.html') diff --git a/docs/doc/group.html b/docs/doc/group.html index 590b166b..2ec68f63 100644 --- a/docs/doc/group.html +++ b/docs/doc/group.html @@ -138,17 +138,17 @@ ⟨ ⟨⟩ ⟨⟩ "string" "with" ⟨⟩ "spaces" ⟩

However, trailing spaces are ignored because Group never produces trailing empty groups (to get them back we would use a dummy final character in the string). To avoid empty words, we should increase the word index only once per group of spaces. We can do this by taking the prefix sum of a list that is 1 only for a space with no space before it. To make such a list, we can use the Windows function. We will extend our list with an initial 1 so that leading spaces will be ignored. Then we take windows of the same length as the original list: the first includes the dummy argument followed by a shifted copy of the list, and the second is the original list. These represent whether the previous and current characters are spaces; we want positions where the previous wasn't a space and the current is.

-
    ((<´<˘)≠↕1∾⊢) ' '="  string with  spaces   "  # All, then filtered, spaces
+
    (<˝≠↕1∾⊢) ' '="  string with  spaces   "  # All, then filtered, spaces
 ┌─                                                 
 ╵ 1 1 0 0 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1  
   0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0  
                                                   ┘
-    (⊢-˜¬×+`((<´<˘)≠↕1∾⊢))' '="  string with  spaces   "  # More processing
+    (⊢-˜¬×+`(<˝≠↕1∾⊢))' '="  string with  spaces   "  # More processing
 ┌─                                                         
 ╵  1  1 0 0 0 0 0 0  1 0 0 0 0  1  1 0 0 0 0 0 0  1  1  1  
   ¯1 ¯1 0 0 0 0 0 0 ¯1 1 1 1 1 ¯1 ¯1 2 2 2 2 2 2 ¯1 ¯1 ¯1  
                                                           ┘
-    ' '((⊢-˜¬×+`((<´<˘)≠↕1∾⊢))=⊔⊢)"  string with  spaces   "  # Final result
+    ' '((⊢-˜¬×+`(<˝≠↕1∾⊢))=⊔⊢)"  string with  spaces   "  # Final result
 ⟨ "string" "with" "spaces" ⟩
 
-- cgit v1.2.3