Skip to content

Commit f0b67f4

Browse files
author
Jonathon Ian Belotti
committed
Fixing loop range bug in pseudocode
1 parent f1cac2c commit f0b67f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

md/CYK-Parse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ __function__ CYK-Parse(_words_, _grammar_) __returns__ _P_, a table of probabili
1212
 /\* Combine first and second parts of right-hand sides of rules, from short to long \*/
1313
 __for__ _length_ = 2 __to__ _N_ __do__
1414
  __for__ _start_ = 1 __to__ _N_ - _length_ + 1 __do__
15-
   __for__ _len1_ = 1 __to__ _N_ - 1 __do__
15+
   __for__ _len1_ = 1 __to__ _length_ - 1 __do__
1616
    _len2_ ← _length_ - _len1_
1717
    __for each__ rule of the form (_X_ → _Y_ _Z_ [_p_]) __do__
1818
     _P_[_X_, _start_, _length_] ← Max(_P_[_X_, _start_, _length_], _P_[_Y_, _start_, _len1_] x _P_[_Z_, _start_ + _len1_, _len2_] x _p_)

0 commit comments

Comments
 (0)