Logo
         Temps de connexion total : 37 minutes.ProfilMembresMessagerieAideRechercherCalendrier

Pages: [1]   En bas
  Répondre  |  Notifier  |  Marquer non lu  |  Partager ce sujet  |  Imprimer  
Auteur Sujet: Apprendre du vocabulaire Japonais  (Lu 88 fois)
EroGaKi et 0 Invités sur ce sujet
$p00ky
<? echo $p00ky ?>
Bébé Yéti is back !
On ne peut plus rien pour moi...
*


Oh enflure démoniaque !

Messages: 1162
Karma: +201/-32
Sexe: Homme
En ligne En ligne

Anime favori: Mnemosyne

Voir le profil WWW En ligne
« le: 27 avril 2007 à 19:57:53 »


Il me semble qu'AkumA voulait un p'tit truc ressemblant à mon script pour apprendre les kana, mais pour apprendre du vocabulaire.
Étant donné que j'avais aussi du vocabulaire à apprendre, j'ai fait un p'tit truc assez basique pour apprendre du vocabulaire.


Bon c'est encore en test et ça vaut pas un clou, cependant comme je file aussi le code source, libre à vous de vous faire plaisir.
Si j'apporte de grosses modifs, je les ferais parvenir ici.

<html>
<head>
<title>P'tit prog pour apprendre son vocabulaire by $p00ky</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>

<body OnLoad="document.repondre.reponse_francais.focus();">
<script language=javascript>document.getElementById('repondre').focus();</script>
<p align=center><b>Apprendre son vocabulaire</b><br><br>
<?php

// Génération du vecteur hiraganas <> katakanas <> romaji
// ----------------------------------------------------------------------

// Le vocabulaire
$tableau[1] = Array(
'romaji' => 'kamikaze',
'hiragana' => '&#12363;&#12415;&#12363;&#12380;',
'kanji' => '&#31070;&#39080;',
'francais' => 'typhon'
);
$tableau[2] = Array(
'romaji' => 'shiitake',
'hiragana' => '&#12375;&#12356;&#12383;&#12369;',
'kanji' => '',
'francais' => 'champignon'
);

$tableau[3] = Array(
'romaji' => 'tomodachi',
'hiragana' => '&#12392;&#12418;&#12384;&#12385;',
'kanji' => '',
'francais' => 'ami'
);

$tableau[4] = Array(
'romaji' => 'hebi',
'hiragana' => '&#12408;&#12403;',
'kanji' => '',
'francais' => 'serpent'
);

$tableau[5] = Array(
'romaji' => 'ebi',
'hiragana' => '&#12360;&#12403;',
'kanji' => '',
'francais' => 'crevette'
);

$tableau[6] = Array(
'romaji' => 'aibo',
'hiragana' => '&#12354;&#12356;&#12412;',
'kanji' => '',
'francais' => 'chien'
);

$tableau[7] = Array(
'romaji' => 'nihon',
'hiragana' => '&#12395;&#12411;&#12435;',
'kanji' => '&#26085;&#26412;',
'francais' => 'Japon'
);

$tableau[8] = Array(
'romaji' => 'nin',
'hiragana' => '&#12395;&#12435;',
'kanji' => '&#20154;',
'francais' => 'personne'
);



function 
kanji_existe($input) {
global 
$tableau;
    return (!(
$tableau[$input]['kanji']==""));
}

function 
kanji($input) {
global 
$tableau;
    if (
$tableau[$input]['kanji']=="") {
    $output $tableau[$input]['hiragana'];
} else {
    $output $tableau[$input]['kanji'];
    }
return $output;
}

function 
romaji($input) {
global 
$tableau;
    return 
$tableau[$input]['romaji'];
}

function 
francais($input) {
global 
$tableau;
    return 
$tableau[$input]['francais'];
}

function 
kana($input) {
global 
$tableau;
    return 
$tableau[$input]['hiragana'];
}

function 
japonais($input) {
global 
$tableau;
    (
kanji_existe($input)) ?
    $output kanji($input)." [".$tableau[$input]['hiragana']."]":
$output $tableau[$input]['hiragana'];
return $output;
}

$min 1;
$max count($tableau);

// Si on est en mode affichage du vocabulaire
if (isset($_GET['afficher'])) {
  echo 
"<br><br><table align=center width=500 cellpadding=2px cellspacing=0><tr><td colspan=4 style=\"background-color:black;\" align=center><b><font color=white>Liste de vocabulaire</font></b></td></tr>";
  echo 
"<tr><td style=\"background-color:#cccccc;\" align=center><b><font color=white>Romaji</font></b></td>";
  echo 
"<td style=\"background-color:#cccccc;\" align=center><b><font color=white>Kana</font></b></td>";
  echo 
"<td style=\"background-color:#cccccc;\" align=center><b><font color=white>Français</font></b></td>";
  echo 
"<td style=\"background-color:#cccccc;\" align=center><b><font color=white>Kanji</font></b></td></tr>";
  for (
$c=$min;$c<=$max;$c++) {
    echo 
"<tr>";
    echo 
"<td>".romaji($c)."</td>";
echo "<td>".kana($c)."</td>";
echo "<td>".francais($c)."</td>";
echo "<td>";
if (kanji_existe($c)) { echo kanji($c); }
echo "</td>";
echo "</tr>";
  }
  echo 
"</table>";
  echo 
"<br><br><a href=?>
Retour</a></center>";
  exit(1);
}

// Génération des options
//-----------------------------------------
if (isset($_POST['taille'])) {
$taille = $_POST['taille'];
} else {
$taille = "70pt";
}
if (isset($_POST['mode'])) {
$mode = $_POST['mode'];
} else {
$mode = "jp-fr";
}

?>
</p>
<form method=post name=options>
<table align=center width=500 cellpadding=2px cellspacing=0><tr><td colspan=2 style="background-color:black;" align=center><b><font color=white>Changer les options</font></b></td></tr>
  <tr>
<td align=center colspan=2 valign=center>
  Mode : <select name=mode>
      <option value="jp-fr">Japonais -> Français</option>
  <option value="fr-jp">Français -> Japonais</option>
  </select>
  Taille : <select name=taille>
      <option value="70pt">Gros</option>
  <option value="50pt">Moyen</option>
  <option value="30pt">Petit</option>
  </select>
    </td>
  </tr>
  <tr>
    <td colspan=2 style="background-color:black;" align=center>
  <input type=submit value="Changer de mode">
</td>
 </table>
 <br><br><br>
 </form>
 
 <?php
 $reponse_romaji 
"";
 
$reponse_francais "";
 
 
// MODE JAPONAIS  --> FRANÇAIS
 
if ($mode=="jp-fr")
 {
   if (!isset(
$_POST['actuel']))
   {
     
$nb mt_rand($min$max);
   }
   else
   {
     
$nb $_POST['actuel'];
 $question japonais($nb);
 if (isset($_POST['reponse_romaji'])) { $reponse_romaji $_POST['reponse_romaji']; }
 $reponse_francais $_POST['reponse_francais'];
 
 // S'il ne connaît pas la réponse
 if ($reponse_romaji=="?"||$reponse_francais=="?")
 {
   echo "<center>Muhaha ! Alors comme ça on sait pas ? Bouh ! <font color=red size=$taille>$question</font> voulait dire <font color=red size=$taille>".$tableau[$nb]['francais'];
   echo "</font><br>Aller, faut bosser ça ^^<br><br><br></center>";
   $nb mt_rand($min$max);
   $reponse_romaji "";
   $reponse_francais == "";
     }
 else
 {
   // Si c'était un kanji, on teste son écriture en romaji
   if (kanji_existe($nb))
   {
     if ($reponse_romaji == romaji($nb))
 {
   echo "<center>Oui, <font size=$taille>".kanji($nb)."</font> est bien <font size=$taille>$reponse_romaji</font></center><br>";
 }
 else
 {
   echo "<center>Ah non, ".kanji($nb)." n'est pas $reponse_romaji</center><br>";
 }
   }
   
   // On teste sa traduction
   if ($reponse_francais == francais($nb))
   {
     echo "<center>Oui, <font size=$taille>".kanji($nb)."</font> est bien <font size=$taille>$reponse_francais</font></center><br>";
   }
   else
   {
     echo "<center>Ah non, ".kanji($nb)." ne signifie pas $reponse_francais</center><br>";
   }
   
   // A-t-on eu les deux justes ?
   if (($reponse_francais == francais($nb))&&(!kanji_existe($nb)||(kanji_existe($nb)&&($reponse_romaji == romaji($nb)))))
   {
     $nb mt_rand($min$max);
 $reponse_romaji "";
 $reponse_francais "";
   }
 }
   }

  
$actuel kanji($nb);
  echo 
"<br><br><br><center><font size=$taille>$actuel</font><br><br><br></center><form method=post name=repondre>";
  echo 
"<input type=hidden value=$nb name=actuel><input type=hidden name=mode value=$mode>";
  echo 
"<input type=hidden value=$taille name=taille>";
  echo 
"<center>Signifie en français : <input type=text name=reponse_francais value=$reponse_francais></center><br>";
  if (
kanji_existe($nb))
  {
    echo 
"<center>S'écrit en romaji : <input type=text name=reponse_romaji value=$reponse_romaji></center><br>";
  }
  echo
"<br><center><input type=submit value=\"Répondre\"></center></form>";

  }
  
// MODE FRANÇAIS --> JAPONAIS
 
else 
 {
   if (!isset(
$_POST['actuel']))
   {
     
$nb mt_rand($min$max);
   }
   else
   {
     
$nb $_POST['actuel'];
 $question francais($nb);
 $reponse $_POST['reponse_francais'];
 
 // S'il ne connaît pas la réponse
 if ($reponse=="?")
 {
   echo "<center>Muhaha ! Alors comme ça on sait pas ? Bouh ! <font color=red size=$taille>$question</font> se disait <font color=red size=$taille>".japonais($nb)." : ".$tableau[$nb]['romaji'];
   echo "</font><br>Aller, faut bosser ça ^^<br><br><br></center>";
   $nb mt_rand($min$max);
   $reponse_francais == "";
     }
 else
 {
 
   // On teste sa traduction
   if ($reponse == romaji($nb))
   {
     echo "<center>Oui, <font size=$taille>".francais($nb)."</font> se dit bien <font size=$taille>$reponse</font> ".japonais($nb)."en japonais</center><br>";
 $nb mt_rand($min$max);
 $reponse "";
   }
   else
   {
     echo "<center>Ah non, ".francais($nb)." ne se dit pas $reponse en japonais</center><br>";
   }

 }
   }

  
$actuel kanji($nb);
  echo 
"<br><br><br><p align=center><font size=$taille>$actuel</font><br><br></p><form method=post name=repondre>";
  echo 
"<input type=hidden value=$nb name=actuel><input type=hidden name=mode value=$mode>";
  echo 
"<input type=hidden value=$taille name=taille>";
  echo 
"<center>Se dit en japonais : <input type=text name=reponse_francais value=$reponse></center><br>";
  echo
"<br><center><input type=submit value=\"Répondre\"></center></form>";

  }
 
 
?>

 
 <br><br>
 <center><a href="?afficher=1">Afficher le vocabulaire</a></center>

</center>
</body>
</html>

Share this topic on Del.icio.usShare this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on LiveShare this topic on MySpaceShare this topic on RedditShare this topic on StumbleUponShare this topic on TechnoratiShare this topic on TwitterShare this topic on YahooShare this topic on Google buzz

GGF
Ortho-Fauteur Professionnel
[EroGaKi] Fourmi de la Team
On ne peut plus rien pour moi...
*


IL EST DE RETOUR, TREMBLER PAUVRE MORTEL.

Messages: 2284
Karma: +33/-15
Sexe: Homme
Hors ligne Hors ligne


Voir le profil WWW E-mail Hors ligne
« Répondre #1 le: 30 avril 2007 à 11:48:44 »

ca peut etre utile ceci ^^
Fye-Tofe59
>^.^<
[EroGaKi] Dinosaure de la Team
On ne peut plus rien pour moi...
*


Ex pair en Or tograf...

Messages: 5059
Karma: +166/-27
Sexe: Homme
Hors ligne Hors ligne

Anime favori: Tsubasa Chronicle

Voir le profil WWW E-mail Hors ligne
« Répondre #2 le: 10 juin 2008 à 21:53:02 »

petit up

http://www.crapulescorp.net/japonais/index.php5

site bien fait avec des histoire en hiragana pour s'entrainer a la lecture
raigomaru
La survivante
[EroGaKi] Fourmi de la Team
Happy Flood !
*


Messages: 173
Karma: +13/-3
Sexe: Femme
Hors ligne Hors ligne


Voir le profil E-mail Hors ligne
« Répondre #3 le: 11 juin 2008 à 07:54:58 »

dis voir spooky tu crois qu'il y a moyen de le compiler en .nds?
$p00ky
<? echo $p00ky ?>
Bébé Yéti is back !
On ne peut plus rien pour moi...
*


Oh enflure démoniaque !

Messages: 1162
Karma: +201/-32
Sexe: Homme
En ligne En ligne

Anime favori: Mnemosyne

Voir le profil WWW En ligne
« Répondre #4 le: 11 juin 2008 à 10:54:27 »


Pour Nintendo DS ?
J'ai aucune idée de comment ça fonctionne la DS...

Mais vu que dans cette version, je n'utilise pas de base de données, ça doit être faisable.
Par contre faudrait plutôt utiliser un fichier .xml séparé pour gérer le voca je pense.
Fye-Tofe59
>^.^<
[EroGaKi] Dinosaure de la Team
On ne peut plus rien pour moi...
*


Ex pair en Or tograf...

Messages: 5059
Karma: +166/-27
Sexe: Homme
Hors ligne Hors ligne

Anime favori: Tsubasa Chronicle

Voir le profil WWW E-mail Hors ligne
« Répondre #5 le: 24 août 2009 à 14:03:38 »

petit up
j'ai trouvé ce petit site sympatique pour des revision sur les hiragana et katakana
 
http://www.kanamichan.com/
Pages: [1]   En haut
  Répondre  |  Notifier  |  Marquer non lu  |  Partager ce sujet  |  Imprimer  
 
 

+ Réponse Rapide
Dans la Réponse Rapide, vous pouvez utiliser du BBCode et des smileys comme sur un message normal, mais à partir d'une interface plus rapide d'accès.

Attention, il n'y a pas eu de réponse à ce sujet depuis au moins 120 jours.
À moins que vous ne soyez sûr de vouloir répondre, pensez éventuellement à créer un nouveau sujet.

Portal Management Extension PortaMx v0.961-1 | PortaMx © 2008-2009 by PortaMx corp.
Powered by SMF 2.0 RC1.2 | SMF © 2006–2009, Simple Machines LLC
XHTML RSS WAP2
Page générée en 0.422 secondes avec 25 requêtes. (Pretty URLs adds 0.003s, 0q)