3v4l.org

run code in 300+ PHP versions simultaneously
<?php class KlassifizierterText { private $text; private $klasse; private $lexikonGroesse; function __construct($paramText = null, $paramKlasse = null) { if(!empty($paramText)) $this->setzeText($paramText); if(!empty($paramKlasse)) $this->setzeKlasse($paramKlasse); } public function setzeText($paramText) { $this->text = $paramText; $this->lexikonGroesse = $this->berechneLexikonGroesse(); } public function setzeKlasse($paramKlasse) { $this->klasse = $paramKlasse; } public function gibText() { return $this->text; } public function gibWoerterInArray() { return explode(" ", $this->text); } public function gibKlasse() { return $this->klasse; } public function gibLexikonGroesse() { return $this->lexikonGroesse; } private function berechneLexikonGroesse(){ $woerter = explode(" ", $this->text); return array_count_values($woerter); } } class BayesKlassifikation { private $kTexte; private $uText; private $wahrscheinlichkeitUText; function __construct($paramKTexte = null, $paramUText = null) { if(!empty($paramKTexte)) $this->setzeKTexte($paramKTexte); if(!empty($paramUText)) $this->setzeUText($paramUText); } public function setzeKTexte($paramKTexte) { $this->kTexte = $paramKTexte; } public function setzeUText($paramUText) { $this->uText = $paramUText; } public function gibKTexte() { return $this->kTexte; } public function gibUText() { return $this->uText; } public function gibWahrscheinlichsteKlasseVonUText(){ if(empty($this->wahrscheinlichkeitUText)) $this->wahrscheinlichkeitUText = $this->berechneWahrscheinlichsteKlasseVonText($kTexte, array("chinesischer Text", "japanischer Text"), $uText); return $this->wahrscheinlichkeitUText; } public static function berechneKlassenWahrscheinlichkeit($kTexte, $klasse) { $klassen = array(); foreach($kTexte as $kText){ if($kText->gibKlasse()) array_push($klassen, $kText->gibKlasse()); } $klassenCounts = array_count_values($klassen); return ($klassenCounts[$klasse]/count($klassen)); } public static function berechneGesamtLexikonGroesse($kTexte) { $gesLexikon = array(); foreach($kTexte as $kText){ foreach($kText->gibLexikonGroesse() as $key => $value){ if(!array_key_exists($key, $gesLexikon)) $gesLexikon[$key] = 0; $gesLexikon[$key] += $value; } } return count($gesLexikon); } public static function berechneKlassenGroesse($kTexte, $klasse) { $klassenGroesse = 0; foreach($kTexte as $kText){ if($kText->gibKlasse() == $klasse){ $klassenGroesse += array_sum($kText->gibLexikonGroesse()); } } return $klassenGroesse; } public static function berechneWortWahrscheinlichkeitInKlasse($kTexte, $klasse, $wort) { $klassenLexikon = array(); foreach($kTexte as $kText){ if($kText->gibKlasse() == $klasse){ foreach($kText->gibLexikonGroesse() as $key => $value){ if(!array_key_exists($key, $klassenLexikon)) $klassenLexikon[$key] = 0; $klassenLexikon[$key] += $value; } } } if(array_key_exists($wort, $klassenLexikon)) return $klassenLexikon[$wort]; else return 0; } public static function berechneTextWahrscheinlichkeitInKlasse($kTexte, $klasse, $kText) { $woerterArray = $kText->gibWoerterInArray(); $wortWahrscheinlichkeit = 1; for($i = 0; $i < count($woerterArray); $i++){ $tmpWortWahrscheinlichkeit = ($this->berechneWortWahrscheinlichkeitInKlasse($kTexte, $klasse, $woerterArray[$i]) + 1)/ ($this->berechneKlassenGroesse($kTexte, $klasse) + $this->berechneGesamtLexikonGroesse($kTexte)); $wortWahrscheinlichkeit *= $tmpWortWahrscheinlichkeit; } return $this->berechneKlassenWahrscheinlichkeit($kTexte, $klasse) * $wortWahrscheinlichkeit; } public static function berechneWahrscheinlichsteKlasseVonText($kTexte, $klassen, $uText) { $wahrscheinlichkeitenKlassen = array(); foreach($klassen as $klasse){ $tmpWahrscheinlichkeit = $this->berechneTextWahrscheinlichkeitInKlasse($kTexte, $klasse, $uText); $wahrscheinlichkeitenKlassen[$klasse] = $tmpWahrscheinlichkeit; } $max = array_keys($wahrscheinlichkeitenKlassen, max($wahrscheinlichkeitenKlassen)); return $max[0]; } } // Start - init: $kText1 = new KlassifizierterText("China Peking China", "chinesischer Text"); $kText2 = new KlassifizierterText("China China Schanghai", "chinesischer Text"); $kText3 = new KlassifizierterText("China Honkong", "chinesischer Text"); $kText4 = new KlassifizierterText("Tokio Japan China", "japanischer Text"); $kTexte = array($kText1, $kText2, $kText3, $kText4); $uText = new KlassifizierterText("China China China Tokio Japan"); $bayesKlassifikation = new BayesKlassifikation(); $bayesKlassifikation->setzeKTexte($kTexte); $bayesKlassifikation->setzeUText($uText); $wahrscheinlichsteKlasse = $bayesKlassifikation->gibWahrscheinlichsteKlasseVonUText(); //echo $wahrscheinlichesteKlasse;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H1BmU
function name:  (null)
number of ops:  42
compiled vars:  !0 = $kText1, !1 = $kText2, !2 = $kText3, !3 = $kText4, !4 = $kTexte, !5 = $uText, !6 = $bayesKlassifikation, !7 = $wahrscheinlichsteKlasse
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  148     0  E >   NEW                                              $8      'KlassifizierterText'
          1        SEND_VAL_EX                                              'China+Peking+China'
          2        SEND_VAL_EX                                              'chinesischer+Text'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $8
  149     5        NEW                                              $11     'KlassifizierterText'
          6        SEND_VAL_EX                                              'China+China+Schanghai'
          7        SEND_VAL_EX                                              'chinesischer+Text'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $11
  150    10        NEW                                              $14     'KlassifizierterText'
         11        SEND_VAL_EX                                              'China+Honkong'
         12        SEND_VAL_EX                                              'chinesischer+Text'
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !2, $14
  151    15        NEW                                              $17     'KlassifizierterText'
         16        SEND_VAL_EX                                              'Tokio+Japan+China'
         17        SEND_VAL_EX                                              'japanischer+Text'
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !3, $17
  153    20        INIT_ARRAY                                       ~20     !0
         21        ADD_ARRAY_ELEMENT                                ~20     !1
         22        ADD_ARRAY_ELEMENT                                ~20     !2
         23        ADD_ARRAY_ELEMENT                                ~20     !3
         24        ASSIGN                                                   !4, ~20
  155    25        NEW                                              $22     'KlassifizierterText'
         26        SEND_VAL_EX                                              'China+China+China+Tokio+Japan'
         27        DO_FCALL                                      0          
         28        ASSIGN                                                   !5, $22
  157    29        NEW                                              $25     'BayesKlassifikation'
         30        DO_FCALL                                      0          
         31        ASSIGN                                                   !6, $25
  158    32        INIT_METHOD_CALL                                         !6, 'setzeKTexte'
         33        SEND_VAR_EX                                              !4
         34        DO_FCALL                                      0          
  159    35        INIT_METHOD_CALL                                         !6, 'setzeUText'
         36        SEND_VAR_EX                                              !5
         37        DO_FCALL                                      0          
  161    38        INIT_METHOD_CALL                                         !6, 'gibWahrscheinlichsteKlasseVonUText'
         39        DO_FCALL                                      0  $30     
         40        ASSIGN                                                   !7, $30
  163    41      > RETURN                                                   1

Class KlassifizierterText:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
Branch analysis from position: 8
filename:       /in/H1BmU
function name:  __construct
number of ops:  15
compiled vars:  !0 = $paramText, !1 = $paramKlasse
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV_INIT                                        !0      null
          1        RECV_INIT                                        !1      null
   10     2        ISSET_ISEMPTY_CV                                 ~2      !0
          3        BOOL_NOT                                         ~3      ~2
          4      > JMPZ                                                     ~3, ->8
          5    >   INIT_METHOD_CALL                                         'setzeText'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0          
   11     8    >   ISSET_ISEMPTY_CV                                 ~5      !1
          9        BOOL_NOT                                         ~6      ~5
         10      > JMPZ                                                     ~6, ->14
         11    >   INIT_METHOD_CALL                                         'setzeKlasse'
         12        SEND_VAR_EX                                              !1
         13        DO_FCALL                                      0          
   12    14    > > RETURN                                                   null

End of function __construct

Function setzetext:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H1BmU
function name:  setzeText
number of ops:  8
compiled vars:  !0 = $paramText
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        ASSIGN_OBJ                                               'text'
          2        OP_DATA                                                  !0
   16     3        INIT_METHOD_CALL                                         'berechneLexikonGroesse'
          4        DO_FCALL                                      0  $3      
          5        ASSIGN_OBJ                                               'lexikonGroesse'
          6        OP_DATA                                                  $3
   17     7      > RETURN                                                   null

End of function setzetext

Function setzeklasse:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H1BmU
function name:  setzeKlasse
number of ops:  4
compiled vars:  !0 = $paramKlasse
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        ASSIGN_OBJ                                               'klasse'
          2        OP_DATA                                                  !0
   21     3      > RETURN                                                   null

End of function setzeklasse

Function gibtext:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H1BmU
function name:  gibText
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   FETCH_OBJ_R                                      ~0      'text'
          1      > RETURN                                                   ~0
   25     2*     > RETURN                                                   null

End of function gibtext

Function gibwoerterinarray:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H1BmU
function name:  gibWoerterInArray
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   INIT_FCALL                                               'explode'
          1        SEND_VAL                                                 '+'
          2        FETCH_OBJ_R                                      ~0      'text'
          3        SEND_VAL                                                 ~0
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
   29     6*     > RETURN                                                   null

End of function gibwoerterinarray

Function gibklasse:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H1BmU
function name:  gibKlasse
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   FETCH_OBJ_R                                      ~0      'klasse'
          1      > RETURN                                                   ~0
   33     2*     > RETURN                                                   null

End of function gibklasse

Function giblexikongroesse:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H1BmU
function name:  gibLexikonGroesse
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   FETCH_OBJ_R                                      ~0      'lexikonGroesse'
          1      > RETURN                                                   ~0
   37     2*     > RETURN                                                   null

End of function giblexikongroesse

Function berechnelexikongroesse:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H1BmU
function name:  berechneLexikonGroesse
number of ops:  11
compiled vars:  !0 = $woerter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   INIT_FCALL                                               'explode'
          1        SEND_VAL                                                 '+'
          2        FETCH_OBJ_R                                      ~1      'text'
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5        ASSIGN                                                   !0, $2
   41     6        INIT_FCALL                                               'array_count_values'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $4      
          9      > RETURN                                                   $4
   42    10*     > RETURN                                                   null

End of function berechnelexikongroesse

End of class KlassifizierterText.

Class BayesKlassifikation:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
Branch analysis from position: 8
filename:       /in/H1BmU
function name:  __construct
number of ops:  15
compiled vars:  !0 = $paramKTexte, !1 = $paramUText
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   51     0  E >   RECV_INIT                                        !0      null
          1        RECV_INIT                                        !1      null
   52     2        ISSET_ISEMPTY_CV                                 ~2      !0
          3        BOOL_NOT                                         ~3      ~2
          4      > JMPZ                                                     ~3, ->8
          5    >   INIT_METHOD_CALL                                         'setzeKTexte'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0          
   53     8    >   ISSET_ISEMPTY_CV                                 ~5      !1
          9        BOOL_NOT                                         ~6      ~5
         10      > JMPZ                                                     ~6, ->14
         11    >   INIT_METHOD_CALL                                         'setzeUText'
         12        SEND_VAR_EX                                              !1
         13        DO_FCALL                                      0          
   54    14    > > RETURN                                                   null

End of function __construct

Function setzektexte:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H1BmU
function name:  setzeKTexte
number of ops:  4
compiled vars:  !0 = $paramKTexte
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   56     0  E >   RECV                                             !0      
   57     1        ASSIGN_OBJ                                               'kTexte'
          2        OP_DATA                                                  !0
   58     3      > RETURN                                                   null

End of function setzektexte

Function setzeutext:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H1BmU
function name:  setzeUText
number of ops:  4
compiled vars:  !0 = $paramUText
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   60     0  E >   RECV                                             !0      
   61     1        ASSIGN_OBJ                                               'uText'
          2        OP_DATA                                                  !0
   62     3      > RETURN                                                   null

End of function setzeutext

Function gibktexte:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H1BmU
function name:  gibKTexte
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   65     0  E >   FETCH_OBJ_R                                      ~0      'kTexte'
          1      > RETURN                                                   ~0
   66     2*     > RETURN                                                   null

End of function gibktexte

Function gibutext:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H1BmU
function name:  gibUText
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   69     0  E >   FETCH_OBJ_R                                      ~0      'uText'
          1      > RETURN                                                   ~0
   70     2*     > RETURN                                                   null

End of function gibutext

Function gibwahrscheinlichsteklassevonutext:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 9
Branch analysis from position: 2
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/H1BmU
function name:  gibWahrscheinlichsteKlasseVonUText
number of ops:  12
compiled vars:  !0 = $kTexte, !1 = $uText
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   73     0  E >   ISSET_ISEMPTY_PROP_OBJ                                   'wahrscheinlichkeitUText'
          1      > JMPZ                                                     ~2, ->9
   74     2    >   INIT_METHOD_CALL                                         'berechneWahrscheinlichsteKlasseVonText'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAL_EX                                              <array>
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0  $4      
          7        ASSIGN_OBJ                                               'wahrscheinlichkeitUText'
          8        OP_DATA                                                  $4
   75     9    >   FETCH_OBJ_R                                      ~5      'wahrscheinlichkeitUText'
         10      > RETURN                                                   ~5
   76    11*     > RETURN                                                   null

End of function gibwahrscheinlichsteklassevonutext

Function berechneklassenwahrscheinlichkeit:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 14
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/H1BmU
function name:  berechneKlassenWahrscheinlichkeit
number of ops:  25
compiled vars:  !0 = $kTexte, !1 = $klasse, !2 = $klassen, !3 = $kText, !4 = $klassenCounts
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   78     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   79     2        ASSIGN                                                   !2, <array>
   80     3      > FE_RESET_R                                       $6      !0, ->15
          4    > > FE_FETCH_R                                               $6, !3, ->15
   81     5    >   INIT_METHOD_CALL                                         !3, 'gibKlasse'
          6        DO_FCALL                                      0  $7      
          7      > JMPZ                                                     $7, ->14
          8    >   INIT_FCALL                                               'array_push'
          9        SEND_REF                                                 !2
         10        INIT_METHOD_CALL                                         !3, 'gibKlasse'
         11        DO_FCALL                                      0  $8      
         12        SEND_VAR                                                 $8
         13        DO_ICALL                                                 
   80    14    > > JMP                                                      ->4
         15    >   FE_FREE                                                  $6
   83    16        INIT_FCALL                                               'array_count_values'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                         $10     
         19        ASSIGN                                                   !4, $10
   84    20        FETCH_DIM_R                                      ~12     !4, !1
         21        COUNT                                            ~13     !2
         22        DIV                                              ~14     ~12, ~13
         23      > RETURN                                                   ~14
   85    24*     > RETURN                                                   null

End of function berechneklassenwahrscheinlichkeit

Function berechnegesamtlexikongroesse:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 19
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 17
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 14
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 17
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/H1BmU
function name:  berechneGesamtLexikonGroesse
number of ops:  23
compiled vars:  !0 = $kTexte, !1 = $gesLexikon, !2 = $kText, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   87     0  E >   RECV                                             !0      
   88     1        ASSIGN                                                   !1, <array>
   89     2      > FE_RESET_R                                       $6      !0, ->19
          3    > > FE_FETCH_R                                               $6, !2, ->19
   90     4    >   INIT_METHOD_CALL                                         !2, 'gibLexikonGroesse'
          5        DO_FCALL                                      0  $7      
          6      > FE_RESET_R                                       $8      $7, ->17
          7    > > FE_FETCH_R                                       ~9      $8, !3, ->17
          8    >   ASSIGN                                                   !4, ~9
   91     9        ARRAY_KEY_EXISTS                                 ~11     !4, !1
         10        BOOL_NOT                                         ~12     ~11
         11      > JMPZ                                                     ~12, ->14
   92    12    >   ASSIGN_DIM                                               !1, !4
         13        OP_DATA                                                  0
   93    14    >   ASSIGN_DIM_OP                +=               1          !1, !4
         15        OP_DATA                                                  !3
   90    16      > JMP                                                      ->7
         17    >   FE_FREE                                                  $8
   89    18      > JMP                                                      ->3
         19    >   FE_FREE                                                  $6
   96    20        COUNT                                            ~15     !1
         21      > RETURN                                                   ~15
   97    22*     > RETURN                                                   null

End of function berechnegesamtlexikongroesse

Function berechneklassengroesse:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 16
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 15
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/H1BmU
function name:  berechneKlassenGroesse
number of ops:  19
compiled vars:  !0 = $kTexte, !1 = $klasse, !2 = $klassenGroesse, !3 = $kText
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   99     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  100     2        ASSIGN                                                   !2, 0
  101     3      > FE_RESET_R                                       $5      !0, ->16
          4    > > FE_FETCH_R                                               $5, !3, ->16
  102     5    >   INIT_METHOD_CALL                                         !3, 'gibKlasse'
          6        DO_FCALL                                      0  $6      
          7        IS_EQUAL                                                 !1, $6
          8      > JMPZ                                                     ~7, ->15
  103     9    >   INIT_FCALL                                               'array_sum'
         10        INIT_METHOD_CALL                                         !3, 'gibLexikonGroesse'
         11        DO_FCALL                                      0  $8      
         12        SEND_VAR                                                 $8
         13        DO_ICALL                                         $9      
         14        ASSIGN_OP                                     1          !2, $9
  101    15    > > JMP                                                      ->4
         16    >   FE_FREE                                                  $5
  106    17      > RETURN                                                   !2
  107    18*     > RETURN                                                   null

End of function berechneklassengroesse

Function berechnewortwahrscheinlichkeitinklasse:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 25
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 25
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 24
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 23
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 23
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 20
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 23
Branch analysis from position: 24
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 31
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/H1BmU
function name:  berechneWortWahrscheinlichkeitInKlasse
number of ops:  33
compiled vars:  !0 = $kTexte, !1 = $klasse, !2 = $wort, !3 = $klassenLexikon, !4 = $kText, !5 = $value, !6 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  109     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
  110     3        ASSIGN                                                   !3, <array>
  111     4      > FE_RESET_R                                       $8      !0, ->25
          5    > > FE_FETCH_R                                               $8, !4, ->25
  112     6    >   INIT_METHOD_CALL                                         !4, 'gibKlasse'
          7        DO_FCALL                                      0  $9      
          8        IS_EQUAL                                                 !1, $9
          9      > JMPZ                                                     ~10, ->24
  113    10    >   INIT_METHOD_CALL                                         !4, 'gibLexikonGroesse'
         11        DO_FCALL                                      0  $11     
         12      > FE_RESET_R                                       $12     $11, ->23
         13    > > FE_FETCH_R                                       ~13     $12, !5, ->23
         14    >   ASSIGN                                                   !6, ~13
  114    15        ARRAY_KEY_EXISTS                                 ~15     !6, !3
         16        BOOL_NOT                                         ~16     ~15
         17      > JMPZ                                                     ~16, ->20
  115    18    >   ASSIGN_DIM                                               !3, !6
         19        OP_DATA                                                  0
  116    20    >   ASSIGN_DIM_OP                +=               1          !3, !6
         21        OP_DATA                                                  !5
  113    22      > JMP                                                      ->13
         23    >   FE_FREE                                                  $12
  111    24    > > JMP                                                      ->5
         25    >   FE_FREE                                                  $8
  120    26        ARRAY_KEY_EXISTS                                         !2, !3
         27      > JMPZ                                                     ~19, ->31
  121    28    >   FETCH_DIM_R                                      ~20     !3, !2
         29      > RETURN                                                   ~20
         30*       JMP                                                      ->32
  122    31    > > RETURN                                                   0
  123    32*     > RETURN                                                   null

End of function berechnewortwahrscheinlichkeitinklasse

Function berechnetextwahrscheinlichkeitinklasse:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 9
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 9
Branch analysis from position: 35
Branch analysis from position: 9
filename:       /in/H1BmU
function name:  berechneTextWahrscheinlichkeitInKlasse
number of ops:  43
compiled vars:  !0 = $kTexte, !1 = $klasse, !2 = $kText, !3 = $woerterArray, !4 = $wortWahrscheinlichkeit, !5 = $i, !6 = $tmpWortWahrscheinlichkeit
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.49 ms | 1420 KiB | 21 Q