Charty/resources/ChartyPy.py
def fundamentalRule(chart, grammar):
   """The fundamental rule of chart parsing generates new edges by
      combining fitting active and inactive edges.

      Parameters:
      chart - the current chart
   """
   change = False
   for aedge in chart:
      if isActive(aedge):
         for k in range(len(chart)):
            if isInactive(chart[k]):
               if match(aedge, chart[k]):
                  newedge = (aedge[0], chart[k][1], aedge[2] + 1,
                             aedge[3], aedge[4], tuple(list(aedge[5]) + [ k ]))
                  if newedge not in chart:
                     chart.append(newedge)
                     change = True
                     if DEBUG:
                        print "FR Adding edge:", edgeStr(newedge, grammar)
   return change
The fundamental rule of chart parsing generates new edges by
      combining fitting active and inactive edges.

      Parameters:
      chart - the current chart
   
The fundamental rule of chart parsing generates new edges by
combining fitting active and inactive edges.

the current chart
The fundamental rule of chart parsing generates new edges by combining fitting active and inactive edges . the current chart
def fundamentalRule(chart, grammar):
   change = False
   for aedge in chart:
      if isActive(aedge):
         for k in range(len(chart)):
            if isInactive(chart[k]):
               if match(aedge, chart[k]):
                  newedge = (aedge[0], chart[k][1], aedge[2] + 1,
                             aedge[3], aedge[4], tuple(list(aedge[5]) + [ k ]))
                  if newedge not in chart:
                     chart.append(newedge)
                     change = True
                     if DEBUG:
                        print "FR Adding edge:", edgeStr(newedge, grammar)
   return change
def fundamentalRule ( chart , grammar ) : change = False for aedge in chart : if isActive ( aedge ) : for k in range ( len ( chart ) ) : if isInactive ( chart [ k ] ) : if match ( aedge , chart [ k ] ) : newedge = ( aedge [ 0 ] , chart [ k ] [ 1 ] , aedge [ 2 ] + 1 , aedge [ 3 ] , aedge [ 4 ] , tuple ( list ( aedge [ 5 ] ) + [ k ] ) ) if newedge not in chart : chart . append ( newedge ) change = True if DEBUG : print "FR Adding edge:" , edgeStr ( newedge , grammar ) return change
The fundamental rule of chart parsing generates new edges by
combining fitting active and inactive edges.
The fundamental rule of chart parsing generates new edges by combining fitting active and inactive edges .
"""The fundamental rule of chart parsing generates new edges by
      combining fitting active and inactive edges.

      Parameters:
      chart - the current chart
   """
chart
grammar