Exemplo n.º 1
0
	def read( self, shp = None, isr = None ):
		FileReader.read( self, shp, isr )
		self.fids = np.rollaxis( self.fids, -2 )
		
		print "\nPlacing channel dimension first. New shape: {0}".format( self.fids.shape ) 
		
		return self.fids
Exemplo n.º 2
0
    def read(self, shp=None, isr=None):
        FileReader.read(self, shp, isr)
        self.fids = np.rollaxis(self.fids, -2)

        print "\nPlacing channel dimension first. New shape: {0}".format(
            self.fids.shape)

        return self.fids
Exemplo n.º 3
0
	def getDocument(self,docName,docid):
		docPath  = self.__getDocPath__(docName)
		docNameNoExt = splitext(docName)[0]
		reader = FileReader(docPath)
		content = reader.read()
		terms = self.textFilter.filter(content)
		return Document(docid,docNameNoExt,terms)
    def getField(self, xpathString):
        reader = FileReader(self.fileName)
        content = reader.read()
        tree = etree.HTML(content)
        # https://www.w3schools.com/xml/xpath_syntax.asp
        #
        titles = tree.xpath(xpathString)

        return titles
Exemplo n.º 5
0
from FileReader import FileReader

reader = FileReader(
    "C:\ProjectsFun\PythonFun\pyhton_coursera_6(FileReader)\FileReader1.py")
print(reader.read())
Exemplo n.º 6
0
from Sentence import Sentence
from TruthTable import TruthTable
from HornForm import HornForm
from ForwardChaining import ForwardChaining
from BackwardChaining import BackwardChaining

if __name__ == "__main__":

    if len(sys.argv) != 3:
        print("Enter command in following format: iengine method filename")
        print("Methods: TT, FC and BC")
        exit(0)

    # get tell and ask from file of given name
    try:
        tell, ask = FileReader.read(sys.argv[2])
    except:
        print("File not found.")
        sys.exit(0)

    if len(tell) == 0:
        print("No tell found.")
        sys.exit(0)
    if not ask:
        print("No ask found.")
        sys.exit(0)

    method = sys.argv[1]
    # set up knowledge base and method based on chosen method
    # print solution using method and query (ask)
    if method == 'TT':