ObrienlabsDev / science

Science Experiments
Apache License 2.0
0 stars 0 forks source link

Periodic Table Language Model #1

Open obriensystems opened 5 months ago

obriensystems commented 5 months ago
Screenshot 2024-06-23 at 18 23 07
    function render() {
        source = "obrienlabs";
        target = "";//VEsNa";
        split = ['Ve','Es','Na'];
        globalFound = false;
        source = source.toUpperCase();
        let adjacent = [];

        // initialize arrays
        for(x=0;x<source.length;x++) {
            adjacent[x] = [];
        }

        // get adjacency matrix in 2 phases 1 char, 2 char)
        for (x=0; x<source.length; x++) {
            for (y=0; y<multiarray.length; y++) {
                current = source[x].toUpperCase();
                element = multiarray[y][1];
                if(element.toUpperCase() == current) {
                    //document.write(element);
                    adjacent[x][y] = element;
                }
                if(x + 1 < source.length) {
                    current = source[x].toUpperCase() + source[x+1].toUpperCase();
                    alert(current);
                    if(element.toUpperCase() == current) {
                        //document.write(element);
                        adjacent[x][y] = element;
                    }
                }
            }
        }