Added README file to docs/ide

created factory manager for idiom classes
Esse commit está contido em:
Felipe Nascimento de Moura
2011-02-06 19:54:20 -02:00
commit a7fa1f0bcb
10 arquivos alterados com 31 adições e 12 exclusões
+2
Ver Arquivo
@@ -0,0 +1,2 @@
Access this file using your browser and see an example of how you can implement
your own interface using the IDE.
+7 -7
Ver Arquivo
@@ -7,7 +7,7 @@
<input type='button' value='run info' onclick="runInfo()"/>
<input type='button' value='show projects' onclick="showProjects()"/>
<input type='button' value='show users' onclick="showUsers()"/>
<input type='button' value='analyze project x' onclick="analyze()"/>
<input type='button' value='analyze project x' onclick="analyzeX()"/>
<input type='button' value='analyze project y' onclick="analyzeY()"/>
<input type='button' value='logoff' onclick="logoff()"/>
</body>
@@ -85,7 +85,7 @@
});
}
function analyze()
function analyzeX()
{
$.ajax({
@@ -97,7 +97,7 @@
name:'x'
},
success: function(ret){
document.getElementById('result').innerHTML= "<br/>"+ret
document.getElementById('result').innerHTML= "";
$.ajax({
type:'POST',
url:'http://localhost/mind/',
@@ -105,7 +105,7 @@
program:'analyze'
},
success: function(ret){
document.getElementById('result').innerHTML+= "<br/>"+ret
document.getElementById('result').innerHTML= ret;
}
});
}
@@ -124,15 +124,15 @@
name:'y'
},
success: function(ret){
document.getElementById('result').innerHTML= "<br/>"+ret
document.getElementById('result').innerHTML= "";
$.ajax({
type:'POST',
url:'http://localhost/mind/',
data:{
program:'analyze'
},
success: function(ret){
document.getElementById('result').innerHTML+= "<br/>"+ret
success: function(retY){
document.getElementById('result').innerHTML= retY;
}
});
}
+1
Ver Arquivo
@@ -26,6 +26,7 @@
public static $tokenizer;
public static $langPath= "";
public static $content= "";
public static $originalContent= "";
public static $curLang= 'en';
/**
+1
Ver Arquivo
@@ -71,6 +71,7 @@ class MindProject {
Mind::$currentProject= $p;
Mind::$curLang= Mind::$currentProject['idiom'];
Mind::$content= '';
//Mind::$
Mind::write('projectOpened', true, $p['name']);
return true;
}
+3
Ver Arquivo
@@ -10,6 +10,7 @@ class Lexer
private $validChars;
private $replacements;
public $lang= 'en';
public $originalContent= '';
private $content= "";
private $tokens= Array();
private $glue= '';
@@ -84,6 +85,7 @@ class Lexer
*/
public function sweep($content)
{
Mind::$originalContent= $content;
// let's treat the single line comments
$content= preg_replace('/\/\/.+\n/', '', $content);
@@ -137,6 +139,7 @@ class Lexer
$fixed= array_filter($exploded);
Mind::$content= $fixed;
$this->content= "";
return sizeof(Mind::$content)>0? Mind::$content: false;
}
+1 -1
Ver Arquivo
@@ -20,7 +20,7 @@ class Analyst {
public static function analize($expression, $structure, $structureKeys){
// let's simply print it as a message, by now
echo implode(' ', $expression).'-'.$structure.'-'.implode('|', $structureKeys).'<br/>';
echo implode(' ', $expression).'-'.$structure.'-'.implode('|', $structureKeys)."<br/>\n";
return true;
}
+5 -1
Ver Arquivo
@@ -10,7 +10,7 @@
class Canonic{
/**
* Takes a word to its canonic form(singular, male form)
* Takes a word to its canonic form(singular/male form)
* @param string$word
* @return string
*/
@@ -34,6 +34,10 @@ class Canonic{
$content= Mind::$content;
$newContent= Array();
// PAREI AQUI
//print_r(Mind::$content);
//echo "\ncanonic--------------------------\n";
Mind::$tokenizer= new Tokenizer();
$ignoreForms= Mind::$currentProject['idiom'].'\IgnoreForms';
$verbalizer= Mind::$currentProject['idiom'].'\Verbalizer';
+1 -1
Ver Arquivo
@@ -25,7 +25,7 @@ class Syntaxer {
public static function loadSintaticList()
{
if(!file_exists('sintatics.list'))
$fR= fopen(Mind::$langPath.Mind::$l10n->name.'/sintatics.list', 'rb');
$fR= fopen(Mind::$langPath.Mind::$curLang.'/sintatics.list', 'rb');
else
$fR= fopen('sintatics.list', 'rb');
+9 -1
Ver Arquivo
@@ -189,6 +189,7 @@ class Tokenizer extends Token{
{
$cont= &Mind::$content;
// seek for data types
foreach(self::$dataTypes as $type=>$options)
{
@@ -204,12 +205,19 @@ class Tokenizer extends Token{
$word= strtolower($word);
$this->add($word);
}
Mind::$syntaxer= new Syntaxer();
return Token::$spine;
}
/**
* The constructor
*/
public function __construct(){
Token::$spine= Array();
self::$spine= Array();
Token::$words= Array();
Token::$string= "";
self::loadModifiers();
}
}
+1 -1
Ver Arquivo
@@ -144,7 +144,7 @@ class Verbalizer {
public static function loadVerbs()
{
if(!file_exists('verbs.list'))
$fR= fopen(\Mind::$langPath.\Mind::$l10n->name.'/verbs.list', 'rb');
$fR= fopen(\Mind::$langPath.\Mind::$curLang.'/verbs.list', 'rb');
else
$fR= fopen('verbs.list', 'rb');
self::$verbs= Array();