June 11, 2017
Lita AI
Imports System.IO

Public Class Gasp

    REM ------------------------------------------------------------------------------------------------------------------
    ' (C) Alexander Peter Obrzut 2017 January 21st ~ 2018 January 22nd
    ' Shotting.cc is a promotional website for Alexander Obrzut's Software Platform
    ' This software concerns language analysis and related language program genie wizzhArd
    ' The language can form a generic AI for software development or BASIC chat Modules
    ' The process should be completely autonomous, supervised due to the fact that it learns
    ' from input files rather than creating iteslf from all possible combinations
    'first task, frequency tests...

    ' With frequency tests nearing completion, I'd like to work on HTML Grammar + HTML Genies
    ' This basically involves readLine() + <br />
    ' To output some VB.NET code GENIE

    ' We need all the source code put into a book for publishing

    ' we need a class structure to build on great things

    ' the ai needs to be able to discover information

    'seperate the information influx into instructions, conditional loops, condition statements, type definitions,
    ' equasions, and pro-grammar (English comments/HTML <p> Paragraphs)
    ' develop 'individuality'
    ' develop a complex system of thought - relational db of thoughts and codes
    ' rotary nodes, interspersed with binary tree nodes
    ' linked list nodes / rotary nodes of char pairs to char word pairs
    ' spaces seperate the word pairs, nothing seperates the char pairs
    ' we need a rationale db designer similar to pms suite
    ' insert new combo box with drop down list of Rotary node, linked list, and binary tree node
    ' then create relationships between the lists

    REM ------------------------------------------------------------------------------------------------------------------

    Public nodes(10000000) As Nodearray
    Public node As New Node

    Public nodeIndex As Integer = 0

    Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click
        OpenFileDialog1.DefaultExt = ".txt"
        OpenFileDialog1.CheckPathExists = True
        OpenFileDialog1.InitialDirectory = Environment.SpecialFolder.MyDocuments
        If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRight.Click
        'fill list box with node frequencies

    End Sub

    Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
    End Sub

    Private Sub SaveAsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveAsToolStripMenuItem.Click
        FolderBrowserDialog1.ShowNewFolderButton = True
        FolderBrowserDialog1.RootFolder = Environment.SpecialFolder.MyDocuments
        Dim dr As Windows.Forms.DialogResult = FolderBrowserDialog1.ShowDialog()

        If dr = Windows.Forms.DialogResult.OK Then
            'MsgBox(FolderBrowserDialog1.SelectedPath, MsgBoxStyle.ApplicationModal, "PATH")

        ElseIf dr = Windows.Forms.DialogResult.Abort Then
        ElseIf dr = Windows.Forms.DialogResult.Cancel Then
        End If
    End Sub

    Private Sub Label5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label5.Click

    End Sub

    Private Sub btnMiddle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMiddle.Click
    End Sub
    Private arayLength = 10000000
    Public ARayLgth = arayLength - 1
    Public fileArray(arayLength) As String
    Public nedRay(arayLength) As Nodearray
    Public AlphaJoin(arayLength) As Nodearray
    Public NodePairs(arayLength, 2) As Nodearray
    Public nodeSets(arayLength, 2) As Nodearray
    Private Sub FrequencyTestsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FrequencyTestsToolStripMenuItem.Click

        Dim nedRayIndx As Double = 0.0

        If Not node Is Nothing Then
            Dim readyOrNotHereIComeImGonnaFindYouAndMakeYouWantMe As String = node.GetPath
            If readyOrNotHereIComeImGonnaFindYouAndMakeYouWantMe.Length > 0 Then
                'Now we're ready and coming for you
                'recursive *.vb search array builder here
                Dim index = 0
                Dim ext As String = ".html"

                Dim result As Double = 0.0

                Dim cls As New IOSearch
                cls.SearchDirectory(New DirectoryInfo(node.GetPath()), fileArray, ext)
                'loop on fileArray() here
                Dim ios As IOSearch = New IOSearch

                While index <= ARayLgth
                    If Not fileArray(index) Is Nothing Then
                        If Not fileArray(index).Length = 0 Then
                            'call file processor
                            Dim zsue As StreamReader
                            Dim sw As StreamWriter
                            Dim ModFile1 As String = fileArray(index)
                                zsue = File.OpenText(ModFile1)
                                sw = File.AppendText("HTMLb.txt")
                            Catch ex As Exception
                                Label5.Text = "File Open Error On " + ModFile1
                            End Try

                            'encode the resources

                            While Not zsue.EndOfStream
                                Dim tempString As String = zsue.ReadLine()

                                Dim StringIndex As Integer = 0
                                While Not StringIndex = tempString.Length
                                    node = ios.Process(tempString, StringIndex)
                                    StringIndex += 1
                                    node.Line = tempString

                                    ' sw.WriteLine("Line: " + node.Line.ToString + " " + node.PreceedingChar + node.token + node.ProceedingChar + " " + node.UniqueIdentifier.ToString)

                                    nedRay(nedRayIndx) = New Nodearray
                                    nedRayIndx += 1

                                End While
                                nodeIndex += 1
                                Label5.Text = nodeIndex.ToString
                            End While

                            If Not zsue Is Nothing Then
                            End If
                            If Not sw Is Nothing Then
                            End If

                        End If

                    End If
                    index += 1
                End While
            End If
        End If

        Dim ReducedNodes(ARayLgth + 1) As Nodearray

        Dim reducedNodesIndx As Double = 0.0

        For i As Double = 0 To nedRayIndx
            Dim stratocaster As Boolean = True

            reducedNodesIndx = 0
            While reducedNodesIndx < ARayLgth
                If Not ReducedNodes(reducedNodesIndx) Is Nothing Then
                        Dim timmy As Node = ReducedNodes(reducedNodesIndx).GetNode()
                            If Not nedRay(i) Is Nothing Then
                                Dim noddy As Node = nedRay(i).GetNode()
                                If timmy.UniqueIdentifier = noddy.UniqueIdentifier Then
                                    stratocaster = False
                                    Exit While
                                End If
                            End If

                        Catch ex As Exception
                            Exit For
                        End Try

                    Catch ex As Exception
                        Exit While
                    End Try

                    Exit While
                End If
                reducedNodesIndx += 1
            End While
            If stratocaster = True Then
                ReducedNodes(reducedNodesIndx) = New Nodearray
                If Not nedRay(i) Is Nothing Then
                End If

            ElseIf stratocaster = False Then

                Dim tempCounterNode As Node = ReducedNodes(reducedNodesIndx).GetNode()

                tempCounterNode.count += 1

                ReducedNodes(reducedNodesIndx) = New Nodearray

            End If
        reducedNodesIndx = 0
        If Not ReducedNodes(reducedNodesIndx) Is Nothing Then
            Dim EnterTheNode As Node = ReducedNodes(reducedNodesIndx).GetNode()
            If EnterTheNode.count < 10 Then
                '            ListBox1.Items.Add(EnterTheNode.PreceedingChar + EnterTheNode.token + EnterTheNode.ProceedingChar + "P:" + EnterTheNode.Position.ToString + "C:" + EnterTheNode.count.ToString + EnterTheNode.Line.ToString)
            End If
        End If
        reducedNodesIndx += 1
        If ReducedNodes(reducedNodesIndx) Is Nothing Then
            GoTo Fin
            GoTo LOOPOLE
        End If

        Dim i_Index As Double = 0
        Dim NedRayLink As Double = nedRayIndx
        While nedRayIndx > 0
            'Pairs the triplets
            If Not nedRay(nedRayIndx) Is Nothing And Not nedRay(nedRayIndx - 3) Is Nothing Then
                Dim A_Node As Node = nedRay(nedRayIndx).GetNode()
                Dim B_Node As Node = nedRay(nedRayIndx - 3).GetNode()

                    '        If A_Node.count > 80 And B_Node.count > 80 Then
                    NodePairs(i_Index, 0) = New Nodearray

                    NodePairs(i_Index, 0).SetNode(A_Node)
                    NodePairs(i_Index, 1) = New Nodearray

                    NodePairs(i_Index, 1).SetNode(B_Node)
                    'End If

                Catch ex As Exception
                End Try

            End If

            nedRayIndx -= 3
            i_Index += 2
            If i_Index >= ARayLgth Then
                i_Index -= 2
                GoTo PENTAGON_DRAGON
            End If

        End While

        Label5.Text = "F"
        nedRayIndx = NedRayLink
        Dim i_End As Integer = i_Index

        For t As Integer = 0 To i_End
            If Not NodePairs(t, 
There is no comment for this article.