Skip to content

normalize-fd apparently unused and not like the manual #1

@itegebo

Description

@itegebo

I understand the manual hasn't been updated in a while (as noted in release notes). Still, I'm trying to use it. The description of normalize-fd doesn't work as expected:

 (normalize-fd '((a ((a1 1)))
                (a ((alt (((a1 2))
                          ((a2 2))))))
                (a nil)
                ({a a3} 3)))
; Debugger entered on #<TYPE-ERROR expected-type: LIST datum: :I>

After poking around a bit, it seems like the following is closer to what was meant (for that example fd):

(filter-flags (u-disjunctions '((a ((a1 1)))
                (a ((alt (((a1 2))
                          ((a2 2))))))
                (a nil)
                ({a a3} 3)) nil))
((A ((A1 1) (A2 2) (A3 3))))

I was unable to find any usages of normalize-fd (in the code base) with which to better understand its meaning. It seems one may need different normalization functions for input and grammar fd's:

(filter-flags (u-disjunctions (get-test 'ir01) nil))
((CAT S) (PROT ((N ===))) (VERB ((V ===))) (GOAL ((N ===))))

So the previous method doesn't work so well on that input fd. But prep-input2 does:

(prep-input2 (get-test 'ir01))
((CAT S) (PROT ((N ((LEX "John"))))) (VERB ((V ((LEX "like")))))
 (GOAL ((N ((LEX "Mary"))))))

But then prep-input2 doesn't work well on the previous grammar-like fd:

(prep-input2 '((a ((a1 1)))
                (a ((alt (((a1 2))
                          ((a2 2))))))
                (a nil)
                ({a a3} 3)))
; Debugger entered on #<TYPE-ERROR expected-type: LIST datum: :I>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions