diff --git a/Gemfile b/Gemfile index eaa60ad..2b6eecb 100644 --- a/Gemfile +++ b/Gemfile @@ -23,7 +23,7 @@ gem "puma", ">= 5.0" gem "importmap-rails" # Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev] -gem "turbo-rails" +#gem "turbo-rails" # Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev] gem "stimulus-rails" diff --git a/Gemfile.lock b/Gemfile.lock index e249ea6..c48ac97 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -282,10 +282,6 @@ GEM thor (1.2.2) tilt (2.3.0) timeout (0.4.0) - turbo-rails (1.5.0) - actionpack (>= 6.0.0) - activejob (>= 6.0.0) - railties (>= 6.0.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unf (0.1.4) @@ -328,7 +324,6 @@ DEPENDENCIES sprockets-rails sqlite3 (~> 1.4) stimulus-rails - turbo-rails tzinfo-data web-console diff --git a/app/controllers/active_language_controller.rb b/app/controllers/active_language_controller.rb index 9041eb1..a7054b4 100644 --- a/app/controllers/active_language_controller.rb +++ b/app/controllers/active_language_controller.rb @@ -3,6 +3,7 @@ class ActiveLanguageController < ApplicationController def set_active_language if Language.find_by_id(params[:active_language_id]) != nil cookies[:active_language_id] = params[:active_language_id] + redirect_back fallback_location: root_path else redirect_to root_path, status: :unprocessable_entity end diff --git a/app/controllers/dictionary_controller.rb b/app/controllers/dictionary_controller.rb index 0f9ba1b..e974c53 100644 --- a/app/controllers/dictionary_controller.rb +++ b/app/controllers/dictionary_controller.rb @@ -1,11 +1,19 @@ class DictionaryController < ApplicationController def index - @parts_of_speech = PartOfSpeech.all + @parts_of_speech = PartOfSpeech.where(language_id: active_language) @words = Word.all end def show @letter = params[:id] @words = Word.where('substr(word, 1, 1) = ?', @letter) + @language = active_language + + #@words.joins(:definitions).where(definitions: { language_id: active_language }) + end + + private + def active_language + cookies[:active_language_id] || Language.where(name: "English") end end diff --git a/app/helpers/active_language_helper.rb b/app/helpers/active_language_helper.rb index ee7afd9..8c6ac24 100644 --- a/app/helpers/active_language_helper.rb +++ b/app/helpers/active_language_helper.rb @@ -1,7 +1,8 @@ module ActiveLanguageHelper def active_language_select_tag - languages = Language.all.to_a.delete_if {|language| language.name == "English" } + #languages = Language.all.to_a.delete_if {|language| language.name == "English" } + languages = Language.all.to_a options = options_from_collection_for_select(languages, "id", "name", cookies[:active_language_id] || 1) select_tag "active_language_id", options, { id: "active_language_select_tag" } end diff --git a/app/javascript/application.js b/app/javascript/application.js index f4c4e40..69df0fd 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -1,5 +1,5 @@ // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails -import "@hotwired/turbo-rails" +//import "@hotwired/turbo-rails" import "controllers" let switchLanguageForm = document.querySelector("#active_language_form"); diff --git a/app/models/word.rb b/app/models/word.rb index fdd33d0..a1eb701 100644 --- a/app/models/word.rb +++ b/app/models/word.rb @@ -1,3 +1,7 @@ class Word < ApplicationRecord has_many :definitions + + def definitions_for(language) + self.definitions.where(language_id: language) + end end diff --git a/app/views/application/_definitions.html.erb b/app/views/application/_definitions.html.erb index 9ce43cc..90616e8 100644 --- a/app/views/application/_definitions.html.erb +++ b/app/views/application/_definitions.html.erb @@ -1,12 +1,12 @@ - - + + -<% word.definitions.each do |definition| %> +<% word.definitions_for(language).each do |definition| %> - - + + <% end %>
Part of SpeechDefinitionPart of SpeechDefinition
<%= definition.pos %><%= definition.definition %><%= definition.pos %><%= definition.definition %>
diff --git a/app/views/application/_partsofspeech.html.erb b/app/views/application/_partsofspeech.html.erb index 36e9fac..8e83aba 100644 --- a/app/views/application/_partsofspeech.html.erb +++ b/app/views/application/_partsofspeech.html.erb @@ -2,13 +2,13 @@ - - + + <% parts_of_speech.each do |item| %> - - + + <% end %>
Part of SpeechDefinitionPart of SpeechDefinition
<%= item.pos %><%= item.definition %><%= item.pos %><%= item.definition %>
diff --git a/app/views/dictionary/show.html.erb b/app/views/dictionary/show.html.erb index cf4eee7..7271ea2 100644 --- a/app/views/dictionary/show.html.erb +++ b/app/views/dictionary/show.html.erb @@ -7,6 +7,6 @@ <% @words.each do |word| %>

<%= word.word %>

- <%= render "definitions", word: word %> + <%= render "definitions", word: word, language: @language %>
<% end %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 3a510a8..4d670a4 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -23,25 +23,9 @@
<%= link_to "Dictionary", dictionary_index_path %> - <% if user_signed_in? %> -
|
- <%= link_to "Languages", admin_languages_path %> -
|
- <%= form_tag '/set_active_language', class: "d-inline", id: "active_language_form" do %> - <%= active_language_select_tag %> - <%= submit_tag "Switch Language", id: "active_language_submit_tag" %> - <% end %> - <% end %> -
-
- <% if user_signed_in? %> -

Welcome <%= current_user.username %>

-
|
- <%= link_to "Sign Out", destroy_user_session_path, data: { turbo_method: :delete } %> - <% else %> - <%= link_to "Sign In", new_user_session_path %> -
|
- <%= link_to "Register", new_user_registration_path %> + <%= form_tag '/set_active_language', class: 'd-inline', id: 'active_language_form' do %> + <%= active_language_select_tag %> + <%= submit_tag "Switch Language", id: "active_language_submit_tag" %> <% end %>
diff --git a/config/routes.rb b/config/routes.rb index f0e8a4c..3807e2a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,19 +1,19 @@ Rails.application.routes.draw do - devise_for :users + #devise_for :users #get 'dictionary/index' resources :dictionary, only: [:index, :show, :create] - resources :words, only: [:index, :show] + #resources :words, only: [:index, :show] post '/set_active_language', action: :set_active_language, controller: :active_language - namespace :admin do - resources :languages - end + #namespace :admin do + # resources :languages + #end # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500. # Can be used by load balancers and uptime monitors to verify that the app is live. - get "up" => "rails/health#show", as: :rails_health_check + #get "up" => "rails/health#show", as: :rails_health_check # Defines the root path route ("/") # root "posts#index" diff --git a/db/dataset_fr/toki-dictionary.json b/db/dataset_fr/toki-dictionary.json new file mode 100644 index 0000000..43a1cf1 --- /dev/null +++ b/db/dataset_fr/toki-dictionary.json @@ -0,0 +1,1651 @@ +[ + { + "word": "a", + "definitions": [ + { + "pos": "interj", + "definition": "ah ! (exclamatif), (accent ou confirmation)" + } + ] + }, + { + "word": "akesi", + "definitions": [ + { + "pos": "n", + "definition": "animal \"moche\", reptile, amphibien" + } + ] + }, + { + "word": "ala", + "definitions": [ + { + "pos": "mod", + "definition": "non, ne...pas, aucun, rien, zéro" + }, + { + "pos": "n", + "definition": "la négation" + }, + { + "pos": "interj", + "definition": "non !" + } + ] + }, + { + "word": "alasa", + "definitions": [ + { + "pos": "vt", + "definition": "chasser, cueillir" + } + ] + }, + { + "word": "ale", + "definitions": [ + { + "pos": "n", + "definition": "l'abondance, la vie, l'univers, l'infini" + }, + { + "pos": "mod", + "definition": "tous, tout" + } + ] + }, + { + "word": "ali", + "definitions": [ + { + "pos": "n", + "definition": "l'abondance, la vie, l'univers, l'infini" + }, + { + "pos": "mod", + "definition": "tous, tout" + } + ] + }, + { + "word": "anpa", + "definitions": [ + { + "pos": "n", + "definition": "le fond, le sol, le bas" + }, + { + "pos": "mod", + "definition": "bas, humble, vers le bas, qui dépend" + }, + { + "pos": "vt", + "definition": "vaincre, abaisser" + }, + { + "pos": "vi", + "definition": "se prosterner" + } + ] + }, + { + "word": "ante", + "definitions": [ + { + "pos": "n", + "definition": "la différence" + }, + { + "pos": "mod", + "definition": "différent, changé, autre" + }, + { + "pos": "conj", + "definition": "sinon" + }, + { + "pos": "vt", + "definition": "changer, modifier" + } + ] + }, + { + "word": "anu", + "definitions": [ + { + "pos": "conj", + "definition": "ou" + } + ] + }, + { + "word": "awen", + "definitions": [ + { + "pos": "vi", + "definition": "rester, continuer" + }, + { + "pos": "vt", + "definition": "garder, attendre" + }, + { + "pos": "mod", + "definition": "resté, protégé, gardé, qui attend, qui persiste," + } + ] + }, + { + "word": "e", + "definitions": [ + { + "pos": "sep", + "definition": "(introduit l'objet direct)" + } + ] + }, + { + "word": "en", + "definitions": [ + { + "pos": "conj", + "definition": "et (utilisé entre plusieurs sujets)" + } + ] + }, + { + "word": "esun", + "definitions": [ + { + "pos": "n", + "definition": "une boutique, un magasin, un commerce" + }, + { + "pos": "vt", + "definition": "acheter, vendre, échanger" + } + ] + }, + { + "word": "ijo", + "definitions": [ + { + "pos": "n", + "definition": "une chose, un phénomène, un objet, la matière" + } + ] + }, + { + "word": "ike", + "definitions": [ + { + "pos": "mod", + "definition": "mauvais, négatif, mal" + }, + { + "pos": "interj", + "definition": "oh cher !, malheur !, hélas !" + }, + { + "pos": "n", + "definition": "la négativité, la méchanceté, le mal" + }, + { + "pos": "vt", + "definition": "rendre mauvais, aggraver, avoir un effet négatif sur..." + }, + { + "pos": "vi", + "definition": "être mauvais" + } + ] + }, + { + "word": "ilo", + "definitions": [ + { + "pos": "n", + "definition": "un outil, un instrument, une machine, un appareil" + } + ] + }, + { + "word": "insa", + "definitions": [ + { + "pos": "n", + "definition": "le centre, le contenu, l'intérieur, l'estomac" + }, + { + "pos": "mod", + "definition": "intérieur, central, entre" + } + ] + }, + { + "word": "jaki", + "definitions": [ + { + "pos": "mod", + "definition": "dégoûtant, obscène, toxique, impur" + }, + { + "pos": "n", + "definition": "la polution, la saleté, des ordures" + }, + { + "pos": "vt", + "definition": "polluer, salir" + }, + { + "pos": "interj", + "definition": "berk !" + } + ] + }, + { + "word": "jan", + "definitions": [ + { + "pos": "n", + "definition": "un être humain, une personne, quelqu'un" + }, + { + "pos": "vt", + "definition": "personnifier, humaniser, personnaliser" + } + ] + }, + { + "word": "jelo", + "definitions": [ + { + "pos": "mod", + "definition": "jaune (ou approchant), vert clair" + } + ] + }, + { + "word": "jo", + "definitions": [ + { + "pos": "vt", + "definition": "avoir, contenir, tenir, posséder" + }, + { + "pos": "n", + "definition": "la possession" + }, + { + "pos": "kama", + "definition": "recevoir" + } + ] + }, + { + "word": "kala", + "definitions": [ + { + "pos": "n", + "definition": "poisson, créature aquatique" + } + ] + }, + { + "word": "kalama", + "definitions": [ + { + "pos": "n", + "definition": "le son, un bruit, la voix" + }, + { + "pos": "vi", + "definition": "émettre un son, réciter, proférer" + }, + { + "pos": "vt", + "definition": "sonner, jouer (d'un instrument)" + } + ] + }, + { + "word": "kama", + "definitions": [ + { + "pos": "vi", + "definition": "venir, devenir, succéder, arriver, réussir à, commencer à, poursuivre des actions dans le but de" + }, + { + "pos": "n", + "definition": "l'arrivée, le début, le futur" + }, + { + "pos": "mod", + "definition": "qui arrive, qui vient, futur, venu" + }, + { + "pos": "vt", + "definition": "provoquer, convoquer" + } + ] + }, + { + "word": "kasi", + "definitions": [ + { + "pos": "n", + "definition": "une plante, de l'herbe, un arbre, du bois, de la végétation" + } + ] + }, + { + "word": "ken", + "definitions": [ + { + "pos": "vi", + "definition": "pouvoir" + }, + { + "pos": "n", + "definition": "la possibilité, la capacité, la permission" + }, + { + "pos": "vt", + "definition": "permettre, être capable de, être autorisé à" + }, + { + "pos": "cont", + "definition": "il est possible que" + } + ] + }, + { + "word": "kepeken", + "definitions": [ + { + "pos": "prep", + "definition": "avec, à l'aide de" + } + ] + }, + { + "word": "kili", + "definitions": [ + { + "pos": "n", + "definition": "un fruit, un légume, un champignon" + } + ] + }, + { + "word": "kin", + "definitions": [ + { + "pos": "mod", + "definition": "aussi, même, réel, objectivement en effet (met l'accent sur le(s) mot(s) qui le précède)" + } + ] + }, + { + "word": "kipisi", + "definitions": [ + { + "pos": "vt", + "definition": "diviser, séparer, couper, trancher" + }, + { + "pos": "n", + "definition": "une séparation" + } + ] + }, + { + "word": "kiwen", + "definitions": [ + { + "pos": "mod", + "definition": "dur, solide" + }, + { + "pos": "n", + "definition": "objet dur, du métal, une pierre" + } + ] + }, + { + "word": "ko", + "definitions": [ + { + "pos": "n", + "definition": "visqueux, argile, poudre, substance collante, semi-solide" + } + ] + }, + { + "word": "kon", + "definitions": [ + { + "pos": "n", + "definition": "l'air, le souffle, l'esprit, l'odeur, l'âme" + }, + { + "pos": "mod", + "definition": "ressemblant à de l'air, gazeuse" + } + ] + }, + { + "word": "kule", + "definitions": [ + { + "pos": "n", + "definition": "une couleur" + }, + { + "pos": "mod", + "definition": "coloré" + }, + { + "pos": "vt", + "definition": "colorer, peindre" + } + ] + }, + { + "word": "kulupu", + "definitions": [ + { + "pos": "n", + "definition": "une communauté, un groupe, une nation, une collection" + }, + { + "pos": "mod", + "definition": "partagé, public, de la société" + } + ] + }, + { + "word": "kute", + "definitions": [ + { + "pos": "vt", + "definition": "écouter, entendre, faire attention à, obéir" + }, + { + "pos": "n", + "definition": "l'oreille" + }, + { + "pos": "mod", + "definition": "auditif, audience" + } + ] + }, + { + "word": "la", + "definitions": [ + { + "pos": "sep", + "definition": "(entre le contexte et la phrase principale)" + } + ] + }, + { + "word": "lape", + "definitions": [ + { + "pos": "n", + "definition": "le repos" + }, + { + "pos": "vi", + "definition": "dormir" + }, + { + "pos": "mod", + "definition": "dormant" + } + ] + }, + { + "word": "laso", + "definitions": [ + { + "pos": "mod", + "definition": "bleu, vert" + } + ] + }, + { + "word": "lawa", + "definitions": [ + { + "pos": "n", + "definition": "la tête, le mental" + }, + { + "pos": "mod", + "definition": "principal, dirigeant" + }, + { + "pos": "vt", + "definition": "dominer, diriger, guider, mener, contrôler" + } + ] + }, + { + "word": "len", + "definitions": [ + { + "pos": "n", + "definition": "le tissu, les vêtements, le textile, une couverture" + } + ] + }, + { + "word": "lete", + "definitions": [ + { + "pos": "n", + "definition": "le froid" + }, + { + "pos": "mod", + "definition": "froid, frais, cru" + }, + { + "pos": "vt", + "definition": "refroidir" + } + ] + }, + { + "word": "li", + "definitions": [ + { + "pos": "sep", + "definition": "(entre le sujet et son verbe (sauf pour \"mi\" ou \"sina\" seul) ; sert aussi à introduire un nouveau verbe pour le même sujet)" + } + ] + }, + { + "word": "lili", + "definitions": [ + { + "pos": "mod", + "definition": "petit, (un) peu, jeune, moins" + }, + { + "pos": "vt", + "definition": "réduire, raccourcir, rétrécir, amoindrir" + } + ] + }, + { + "word": "linja", + "definitions": [ + { + "pos": "n", + "definition": "objet long et flexible ; une corde, un cheveu, un fil, une ligne" + } + ] + }, + { + "word": "lipu", + "definitions": [ + { + "pos": "n", + "definition": "objet plat ; un livre, un document, une carte, un papier, un site web" + } + ] + }, + { + "word": "loje", + "definitions": [ + { + "pos": "mod", + "definition": "rouge" + } + ] + }, + { + "word": "lon", + "definitions": [ + { + "pos": "prep", + "definition": "à, situé à, dans, sur, réel, vrai, actuel, là" + }, + { + "pos": "vi", + "definition": "être là, être present, être vrai, exister, être éveillé" + } + ] + }, + { + "word": "luka", + "definitions": [ + { + "pos": "n", + "definition": "la main, le bras, l'organe du toucher" + } + ] + }, + { + "word": "lukin", + "definitions": [ + { + "pos": "vt", + "definition": "voir, regarder, lire" + }, + { + "pos": "vi", + "definition": "regarder, faire attention, surveiller, observer, examiner" + }, + { + "pos": "mod", + "definition": "visuellement" + } + ] + }, + { + "word": "lupa", + "definitions": [ + { + "pos": "n", + "definition": "un trou, un orifice, une fenêtre, une porte" + } + ] + }, + { + "word": "ma", + "definitions": [ + { + "pos": "n", + "definition": "une terre, un sol, le monde, un lieu en plein air, un pays, un territoire" + } + ] + }, + { + "word": "mama", + "definitions": [ + { + "pos": "n", + "definition": "un parent, un ancêtre, un créateur, celui ou celle qui prend soin" + }, + { + "pos": "mod", + "definition": "parental, maternel, paternel" + } + ] + }, + { + "word": "mani", + "definitions": [ + { + "pos": "n", + "definition": "l'argent, la richesse, un grand animal domestiqué (du bétail)" + } + ] + }, + { + "word": "meli", + "definitions": [ + { + "pos": "n", + "definition": "une femme, une femelle, une fille, une épouse" + }, + { + "pos": "mod", + "definition": "féminin" + } + ] + }, + { + "word": "mi", + "definitions": [ + { + "pos": "mod", + "definition": "je, moi, nous, mon, ma, mes, notre, nos" + } + ] + }, + { + "word": "mije", + "definitions": [ + { + "pos": "n", + "definition": "un homme, un mâle, un mari, un garçon" + }, + { + "pos": "mod", + "definition": "masculin" + } + ] + }, + { + "word": "moku", + "definitions": [ + { + "pos": "n", + "definition": "de la nourriture, un repas" + }, + { + "pos": "vt", + "definition": "manger, boire, avaler, ingérer, consommer" + } + ] + }, + { + "word": "moli", + "definitions": [ + { + "pos": "n", + "definition": "la mort" + }, + { + "pos": "vi", + "definition": "mourir, être mort" + }, + { + "pos": "vt", + "definition": "tuer" + }, + { + "pos": "mod", + "definition": "mortel, mourant" + } + ] + }, + { + "word": "monsi", + "definitions": [ + { + "pos": "n", + "definition": "le dos, le derrière, l'arrière" + }, + { + "pos": "mod", + "definition": "arrière" + } + ] + }, + { + "word": "mu", + "definitions": [ + { + "pos": "interj", + "definition": "ouaf ! miaou ! (cri ou communication d'animal mignon)" + } + ] + }, + { + "word": "mun", + "definitions": [ + { + "pos": "n", + "definition": "la lune, un astre, une étoile" + }, + { + "pos": "mod", + "definition": "lunaire" + } + ] + }, + { + "word": "musi", + "definitions": [ + { + "pos": "n", + "definition": "l'amusement, le jeu, le loisir, l'art, le divertissement" + }, + { + "pos": "mod", + "definition": "artistique, divertissant, amusant" + }, + { + "pos": "vi", + "definition": "jouer, s'amuser" + }, + { + "pos": "vt", + "definition": "amuser, divertir" + } + ] + }, + { + "word": "mute", + "definitions": [ + { + "pos": "mod", + "definition": "beaucoup, plusieurs, nombreux, plus" + }, + { + "pos": "n", + "definition": "une quantité" + } + ] + }, + { + "word": "namako", + "definitions": [ + { + "pos": "n", + "definition": "un additif alimentaire, un embellissement, une épice, un accessoire, quelque chose en plus" + }, + { + "pos": "vt", + "definition": "épicé, piquant, assaisonner, embellir, stimuler" + } + ] + }, + { + "word": "nanpa", + "definitions": [ + { + "pos": "n", + "definition": "un nombre" + }, + { + "pos": "oth", + "definition": "-ième (nombre ordinal)" + } + ] + }, + { + "word": "nasa", + "definitions": [ + { + "pos": "mod", + "definition": "étrange, insolite, fou, idiot, ivre, stupide, insensé, bizarre" + }, + { + "pos": "vt", + "definition": "rendre fou, rendre bizarre" + } + ] + }, + { + "word": "nasin", + "definitions": [ + { + "pos": "n", + "definition": "un chemin, une voie, une manière, une façon, une coutume, une méthode, une route, une doctrine, un système" + } + ] + }, + { + "word": "nena", + "definitions": [ + { + "pos": "n", + "definition": "le nez, une bosse, une colline, une montagne, un bouton" + } + ] + }, + { + "word": "ni", + "definitions": [ + { + "pos": "mod", + "definition": "ce, cette" + } + ] + }, + { + "word": "nimi", + "definitions": [ + { + "pos": "n", + "definition": "un mot, un nom" + } + ] + }, + { + "word": "noka", + "definitions": [ + { + "pos": "n", + "definition": "un pied, une jambe, l'organe de locomotion" + } + ] + }, + { + "word": "o", + "definitions": [ + { + "pos": "sep", + "definition": "Ô ! (vocatif or imperatif)" + }, + { + "pos": "interj", + "definition": "hé ! (voulant l'attention de qqun)" + } + ] + }, + { + "word": "oko", + "definitions": [ + { + "pos": "n", + "definition": "les yeux" + } + ] + }, + { + "word": "olin", + "definitions": [ + { + "pos": "n", + "definition": "l'amour" + }, + { + "pos": "mod", + "definition": "aimé" + }, + { + "pos": "vt", + "definition": "aimer, respecter, compatir" + } + ] + }, + { + "word": "ona", + "definitions": [ + { + "pos": "n", + "definition": "il(s), elle(s)" + }, + { + "pos": "mod", + "definition": "son, sa, ses, leur(s)" + } + ] + }, + { + "word": "open", + "definitions": [ + { + "pos": "vt", + "definition": "commencer, ouvrir, allumer" + } + ] + }, + { + "word": "pakala", + "definitions": [ + { + "pos": "n", + "definition": "accident, erreur, destruction, dommage, rupture" + }, + { + "pos": "vt", + "definition": "bousiller, bâcler, ruiner, casser, blesser" + }, + { + "pos": "vi", + "definition": "s'effondrer, casser," + }, + { + "pos": "interj", + "definition": "putain !, merde !" + } + ] + }, + { + "word": "pali", + "definitions": [ + { + "pos": "n", + "definition": "l'activité, le travail, un acte, un projet" + }, + { + "pos": "mod", + "definition": "actif, lié au travail, opérationnel, travaillant" + }, + { + "pos": "vt", + "definition": "faire, construire, créer, fournir, préparer" + }, + { + "pos": "vi", + "definition": "agir, travailler, fonctionner" + } + ] + }, + { + "word": "palisa", + "definitions": [ + { + "pos": "n", + "definition": "objet long et dur ; tige, bâton, branche" + } + ] + }, + { + "word": "pan", + "definitions": [ + { + "pos": "n", + "definition": "des céréales, du riz, du blé, de l'orge, du maïs, de l'avoine, du pain, des pâtes" + } + ] + }, + { + "word": "pana", + "definitions": [ + { + "pos": "vt", + "definition": "donner, envoyer, mettre, fournir, lâcher, libérer" + }, + { + "pos": "n", + "definition": "un don, un cadeau" + } + ] + }, + { + "word": "pi", + "definitions": [ + { + "pos": "sep", + "definition": "de" + } + ] + }, + { + "word": "pilin", + "definitions": [ + { + "pos": "n", + "definition": "les sentiments, les émotions, le cœur (physique ou psychologique)" + }, + { + "pos": "mod", + "definition": "qui ressent (une émotion ou une expérience directe)" + }, + { + "pos": "vi", + "definition": "sentir" + } + ] + }, + { + "word": "pimeja", + "definitions": [ + { + "pos": "mod", + "definition": "noir, foncé, sombre" + }, + { + "pos": "n", + "definition": "l'obscurité, une ombre" + }, + { + "pos": "vt", + "definition": "assombrir" + } + ] + }, + { + "word": "pini", + "definitions": [ + { + "pos": "n", + "definition": "la fin" + }, + { + "pos": "mod", + "definition": "fini, passé, complété" + }, + { + "pos": "vt", + "definition": "finir, fermer, éteindre" + } + ] + }, + { + "word": "pipi", + "definitions": [ + { + "pos": "n", + "definition": "un insecte, une araignée, une fourmi" + } + ] + }, + { + "word": "poka", + "definitions": [ + { + "pos": "n", + "definition": "un coté, une proximité, la hanche" + }, + { + "pos": "prep", + "definition": "accompagner de" + }, + { + "pos": "mod", + "definition": "voisin" + } + ] + }, + { + "word": "poki", + "definitions": [ + { + "pos": "n", + "definition": "un sac, un bol, un récipient, une tasse, un placard, un tiroir, un vase" + } + ] + }, + { + "word": "pona", + "definitions": [ + { + "pos": "n", + "definition": "le bonheur, la simplicité, la positivité" + }, + { + "pos": "mod", + "definition": "bon, positif, utile, sympa, paisible, simple" + }, + { + "pos": "interj", + "definition": "super ! bien ! merci ! OK ! cool ! Ouais !" + }, + { + "pos": "vt", + "definition": "améliorer, fixer, rendre bien, rendre mieux" + } + ] + }, + { + "word": "pu", + "definitions": [ + { + "pos": "mod", + "definition": "(entrée pas encore définie dans la liste officielle de mots Toki Pona)" + } + ] + }, + { + "word": "sama", + "definitions": [ + { + "pos": "mod", + "definition": "même, semblable, l'un l'autre, fraternel, homologue" + }, + { + "pos": "prep", + "definition": "comme" + } + ] + }, + { + "word": "seli", + "definitions": [ + { + "pos": "n", + "definition": "le feu, un élément de cuisson, une réaction chimique, la chaleur" + }, + { + "pos": "mod", + "definition": "chaud, cuit" + }, + { + "pos": "vt", + "definition": "chauffer, réchauffer, cuire" + } + ] + }, + { + "word": "selo", + "definitions": [ + { + "pos": "n", + "definition": "l'extérieur, la surface, une limite, une couche extérieur (une peau, une coquille, une écorce)" + } + ] + }, + { + "word": "seme", + "definitions": [ + { + "pos": "oth", + "definition": "quoi ?, quel ?, lequel ?, q- (mot interrogatif)" + } + ] + }, + { + "word": "sewi", + "definitions": [ + { + "pos": "n", + "definition": "chose élevée ; la hauteur, le divin, le sacré, le surnaturel, la religion" + }, + { + "pos": "mod", + "definition": "au-dessus, sur, supérieur, élevé, religieux, formel qui inspire le respect ou la crainte" + } + ] + }, + { + "word": "sijelo", + "definitions": [ + { + "pos": "n", + "definition": "le corps, l'état physique, le torse" + } + ] + }, + { + "word": "sike", + "definitions": [ + { + "pos": "n", + "definition": "objet rond : cercle, roue, sphère, ballon, cycle, anneau" + }, + { + "pos": "mod", + "definition": "rond, cyclique" + } + ] + }, + { + "word": "sin", + "definitions": [ + { + "pos": "mod", + "definition": "nouveau, frais, autre, plus" + }, + { + "pos": "vt", + "definition": "renouveler, rénover, rafraîchir" + } + ] + }, + { + "word": "sina", + "definitions": [ + { + "pos": "n", + "definition": "tu, toi, vous" + }, + { + "pos": "mod", + "definition": "ton, ta, tes, votre, vos" + } + ] + }, + { + "word": "sinpin", + "definitions": [ + { + "pos": "n", + "definition": "le devant, l'avant, la poitrine, le torse, le visage, le mur" + } + ] + }, + { + "word": "sitelen", + "definitions": [ + { + "pos": "n", + "definition": "une photo, une image, une représentation, un symbole, une marque, l'écriture" + }, + { + "pos": "vt", + "definition": "dessiner, écrire" + } + ] + }, + { + "word": "sona", + "definitions": [ + { + "pos": "n", + "definition": "la connaissance, la sagesse, l'intelligence, la compréhension, le savoir" + }, + { + "pos": "vt", + "definition": "savoir, comprendre, savoir comment" + }, + { + "pos": "vi", + "definition": "savoir, comprendre" + }, + { + "pos": "kama", + "definition": "apprendre, étudier" + } + ] + }, + { + "word": "soweli", + "definitions": [ + { + "pos": "n", + "definition": "un animal, un mammifère terrestre, un animal aimable" + } + ] + }, + { + "word": "suli", + "definitions": [ + { + "pos": "mod", + "definition": "grand, lourd, long, adulte, important, large" + }, + { + "pos": "vt", + "definition": "agrandir, allonger" + } + ] + }, + { + "word": "suno", + "definitions": [ + { + "pos": "n", + "definition": "le soleil, la lumière, une lueur" + }, + { + "pos": "mod", + "definition": "brillant" + } + ] + }, + { + "word": "supa", + "definitions": [ + { + "pos": "n", + "definition": "une surface horizontale sur laquelle on peut poser qqch ; un meuble, une table, une chaise, un oreiller, le sol" + } + ] + }, + { + "word": "suwi", + "definitions": [ + { + "pos": "n", + "definition": "des bonbons, des aliments sucrés" + }, + { + "pos": "mod", + "definition": "doux, mignon, parfumé, innocent, adorable" + }, + { + "pos": "vt", + "definition": "adoucir" + } + ] + }, + { + "word": "tan", + "definitions": [ + { + "pos": "prep", + "definition": "de, provenant de, à cause de" + }, + { + "pos": "n", + "definition": "l'origine, la cause" + } + ] + }, + { + "word": "taso", + "definitions": [ + { + "pos": "mod", + "definition": "seulement, uniquement" + }, + { + "pos": "conj", + "definition": "mais, cependant" + } + ] + }, + { + "word": "tawa", + "definitions": [ + { + "pos": "extra", + "definition": "pre à, allant à, afin de, vers, pour, jusqu'à, du point de vue de" + }, + { + "pos": "vi", + "definition": "aller à, marcher, voyager, bouger, partir" + }, + { + "pos": "n", + "definition": "le déplacement, le transport" + }, + { + "pos": "mod", + "definition": "en mouvement, animé" + }, + { + "pos": "vt", + "definition": "déplacer" + } + ] + }, + { + "word": "telo", + "definitions": [ + { + "pos": "n", + "definition": "l'eau, un liquide, un fluide, une substance mouillée, une boisson" + }, + { + "pos": "vt", + "definition": "laver avec de l'eau" + } + ] + }, + { + "word": "tenpo", + "definitions": [ + { + "pos": "n", + "definition": "le temps, la durée, un moment, une occasion, une période, une situation" + } + ] + }, + { + "word": "toki", + "definitions": [ + { + "pos": "n", + "definition": "la langue, la parole, la communication" + }, + { + "pos": "mod", + "definition": "parlant, verbal" + }, + { + "pos": "vt", + "definition": "dire" + }, + { + "pos": "vi", + "definition": "parler, communiquer, penser" + }, + { + "pos": "interj", + "definition": "Bonjour ! Salut !" + } + ] + }, + { + "word": "tomo", + "definitions": [ + { + "pos": "n", + "definition": "espace intérieur construit/lieu couvert ; une maison, un édifice, une chambre, une pièce, un bâtiment, un chez soi" + }, + { + "pos": "mod", + "definition": "urbain, domestique" + } + ] + }, + { + "word": "tu", + "definitions": [ + { + "pos": "mod", + "definition": "deux" + }, + { + "pos": "n", + "definition": "un duo, une paire" + }, + { + "pos": "vt", + "definition": "doubler, séparer/couper/diviser en deux" + } + ] + }, + { + "word": "unpa", + "definitions": [ + { + "pos": "n", + "definition": "le sexe, la sexualité" + }, + { + "pos": "mod", + "definition": "érotique, sexuel" + }, + { + "pos": "vt", + "definition": "avoir des relations sexuelles avec, coucher avec, baiser avec" + }, + { + "pos": "vt", + "definition": "avoir des relations sexuelles" + } + ] + }, + { + "word": "uta", + "definitions": [ + { + "pos": "n", + "definition": "la cavité buccale, la bouche, les lèvres, la mâchoire" + }, + { + "pos": "mod", + "definition": "oral" + } + ] + }, + { + "word": "utala", + "definitions": [ + { + "pos": "n", + "definition": "un conflit, une compétition, une bagarre, une guerre, une attaque, un coup, une dispute, une violence physique ou verbale" + }, + { + "pos": "vt", + "definition": "frapper, attaquer, concurrencer, se battre contre, lutter contre" + } + ] + }, + { + "word": "walo", + "definitions": [ + { + "pos": "mod", + "definition": "blanc, pâle, clair (couleur)" + }, + { + "pos": "n", + "definition": "une chose blanche, une blancheur, une légèreté" + } + ] + }, + { + "word": "wan", + "definitions": [ + { + "pos": "mod", + "definition": "un, unique" + }, + { + "pos": "n", + "definition": "une unité, un élément, une particule, une partie, un morceau" + }, + { + "pos": "vt", + "definition": "unir, faire un" + } + ] + }, + { + "word": "waso", + "definitions": [ + { + "pos": "n", + "definition": "un oiseau, une créatue volante, un animal ailé" + } + ] + }, + { + "word": "wawa", + "definitions": [ + { + "pos": "n", + "definition": "une énergie, une force, une puissance" + }, + { + "pos": "mod", + "definition": "énergique, fort, féroce, intense, confiant, puissant" + }, + { + "pos": "vt", + "definition": "renforcer, dynamiser, responsabiliser" + } + ] + }, + { + "word": "weka", + "definitions": [ + { + "pos": "mod", + "definition": "absent, manquant, éloigné" + }, + { + "pos": "n", + "definition": "une absence" + }, + { + "pos": "vt", + "definition": "jeter, enlever, se débarrasser de, éloigner" + } + ] + }, + { + "word": "wile", + "definitions": [ + { + "pos": "vt", + "definition": "vouloir, avoir besoin, souhaiter" + }, + { + "pos": "n", + "definition": "le désir, le besoin, la volonté" + }, + { + "pos": "mod", + "definition": "nécessaire" + } + ] + } +] \ No newline at end of file diff --git a/db/dataset_fr/toki-lessons.json b/db/dataset_fr/toki-lessons.json new file mode 100644 index 0000000..d909709 --- /dev/null +++ b/db/dataset_fr/toki-lessons.json @@ -0,0 +1,1602 @@ +[ + { + "lesson": "Noms", + "words": [ + { + "word": "ijo", + "definitions": [ + { + "pos": "n", + "definition": "une chose, un phénomène, un objet, la matière" + } + ] + }, + { + "word": "jan", + "definitions": [ + { + "pos": "n", + "definition": "un être humain, une personne, quelqu'un" + }, + { + "pos": "vt", + "definition": "personnifier, humaniser, personnaliser" + } + ] + }, + { + "word": "kili", + "definitions": [ + { + "pos": "n", + "definition": "un fruit, un légume, un champigion" + } + ] + }, + { + "word": "lipu", + "definitions": [ + { + "pos": "n", + "definition": "objet plat ; un livre, un document, une carte, un papier, un site web" + } + ] + }, + { + "word": "meli", + "definitions": [ + { + "pos": "n", + "definition": "une femme, une femelle, une épouse" + }, + { + "pos": "mod", + "definition": "féminin" + } + ] + }, + { + "word": "ni", + "definitions": [ + { + "pos": "mod", + "definition": "ce, cette" + } + ] + }, + { + "word": "soweli", + "definitions": [ + { + "pos": "n", + "definition": "un animal, un mammifère terrestre, un animal aimable" + } + ] + }, + { + "word": "li", + "definitions": [ + { + "pos": "sep", + "definition": "(entre le sujet et son verbe (sauf pour \"mi\" ou \"sina\" seul) ; sert aussi à introduire un nouveau verbe pour le même sujet)" + } + ] + } + ] + }, + { + "lesson": "Noms et Adjectifs", + "words": [ + { + "word": "telo", + "definitions": [ + { + "pos": "n", + "definition": "l'eau, un liquide, un fluide, une substance mouillé, une boission" + }, + { + "pos": "vt", + "definition": "laver avec de l'eau" + } + ] + }, + { + "word": "tomo", + "definitions": [ + { + "pos": "n", + "definition": "espace intérieur construit/lieucouvert ; une maison, un édifice, une chambre, une pièce, un bâtiment, un chez soi" + }, + { + "pos": "mod", + "definition": "urbain, domestique" + } + ] + }, + { + "word": "lili", + "definitions": [ + { + "pos": "mod", + "definition": "petit, (un) peu, jeune, moins" + }, + { + "pos": "vt", + "definition": "réduire, raccourcir, rétrécir, amoindrir" + } + ] + }, + { + "word": "pona", + "definitions": [ + { + "pos": "n", + "definition": "le bonheur, la simplicité, la positivité" + }, + { + "pos": "mod", + "definition": "bon, positif, utile, sympa, paisible, simple" + }, + { + "pos": "interj", + "definition": "super ! bien ! merci ! OK ! cool ! Waa !" + }, + { + "pos": "vt", + "definition": "améliorer, fixer, rendre bien, rendre mieux" + } + ] + }, + { + "word": "suli", + "definitions": [ + { + "pos": "mod", + "definition": "grand, lourd, long, adulte, important, large" + }, + { + "pos": "vt", + "definition": "agrandir, allonger" + } + ] + } + ] + }, + { + "lesson": "Toi et Moi", + "words": [ + { + "word": "mi", + "definitions": [ + { + "pos": "mod", + "definition": "je, moi, nous, mon, ma, mes, notre, nos" + } + ] + }, + { + "word": "mije", + "definitions": [ + { + "pos": "n", + "definition": "un homme, un mâle, un mari, un garçon" + }, + { + "pos": "mod", + "definition": "masculin" + } + ] + }, + { + "word": "sina", + "definitions": [ + { + "pos": "n", + "definition": "tu, toi, vous" + }, + { + "pos": "mod", + "definition": "ton, ta, tes, votre, vos" + } + ] + }, + { + "word": "kulupu", + "definitions": [ + { + "pos": "n", + "definition": "une communauté, un groupe, une nation, une collection" + }, + { + "pos": "mod", + "definition": "partagé, de la société" + } + ] + }, + { + "word": "sin", + "definitions": [ + { + "pos": "mod", + "definition": "nouveau, frais, autre, plus" + }, + { + "pos": "vt", + "definition": "renouveler, rénover, rafraîchir" + } + ] + }, + { + "word": "wawa", + "definitions": [ + { + "pos": "n", + "definition": "une énergie, une force, une puissance" + }, + { + "pos": "mod", + "definition": "énergique, fort, féroce, intense, confiant, puissant" + }, + { + "pos": "vt", + "definition": "renforcer, dynamiser, responsabiliser" + } + ] + } + ] + }, + { + "lesson": "Verbes", + "words": [ + { + "word": "jo", + "definitions": [ + { + "pos": "vt", + "definition": "avoir, contenir, tenir, posséder" + }, + { + "pos": "n", + "definition": "la possession" + }, + { + "pos": "kama", + "definition": "recevoir" + } + ] + }, + { + "word": "kute", + "definitions": [ + { + "pos": "vt", + "definition": "écouter, entendre, faire attention à, obéir" + }, + { + "pos": "n", + "definition": "l'oreille" + }, + { + "pos": "mod", + "definition": "auditif, audience" + } + ] + }, + { + "word": "moku", + "definitions": [ + { + "pos": "n", + "definition": "de la nourriture, un repas" + }, + { + "pos": "vt", + "definition": "manger, boire, avaler, ingérer, consommer" + } + ] + }, + { + "word": "pali", + "definitions": [ + { + "pos": "n", + "definition": "l'activité, le travail, un acte, un projet" + }, + { + "pos": "mod", + "definition": "actif, lié au travail, opérationnel, travaillant" + }, + { + "pos": "vt", + "definition": "faire, construire, créer, fournir, préparer" + }, + { + "pos": "vi", + "definition": "agir, travailler, fonctionner" + } + ] + }, + { + "word": "sona", + "definitions": [ + { + "pos": "n", + "definition": "la connaissance, la sagesse, l'intelligence, la compréhension, le savoir" + }, + { + "pos": "vt", + "definition": "savoir, comprendre, savoir comment" + }, + { + "pos": "vi", + "definition": "savoir, comprendre" + }, + { + "pos": "kama", + "definition": "apprendre, étudier" + } + ] + }, + { + "word": "toki", + "definitions": [ + { + "pos": "n", + "definition": "la langue, la parole, la communication" + }, + { + "pos": "mod", + "definition": "parlant, verbal" + }, + { + "pos": "vt", + "definition": "dire" + }, + { + "pos": "vi", + "definition": "parler, communiquer, penser" + }, + { + "pos": "interj", + "definition": "Bonjour! Hey!" + } + ] + }, + { + "word": "e", + "definitions": [ + { + "pos": "sep", + "definition": "(introduit l'objet direct)" + } + ] + } + ] + }, + { + "lesson": "D'autres Adjectifs", + "words": [ + { + "word": "ala", + "definitions": [ + { + "pos": "mod", + "definition": "non, ne...pas, aucun, rien, zéro" + }, + { + "pos": "n", + "definition": "la négation" + }, + { + "pos": "interj", + "definition": "non !" + } + ] + }, + { + "word": "ike", + "definitions": [ + { + "pos": "mod", + "definition": "mauvais, négatif, mal" + }, + { + "pos": "interj", + "definition": "oh cher !, malheur !, hélas !" + }, + { + "pos": "n", + "definition": "la négativité, la méchanceté, le mal" + }, + { + "pos": "vt", + "definition": "rendre mauvais, aggraver, avoir un effet négatif sur..." + }, + { + "pos": "vi", + "definition": "être mauvais" + } + ] + }, + { + "word": "mute", + "definitions": [ + { + "pos": "mod", + "definition": "beaucoup, plusieurs, nombreux, plus" + }, + { + "pos": "n", + "definition": "une quantité" + } + ] + }, + { + "word": "pu", + "definitions": [ + { + "pos": "mod", + "definition": "interagissant avec le livre officiel du Toki Pona" + } + ] + }, + { + "word": "sewi", + "definitions": [ + { + "pos": "n", + "definition": "chose élevée ; la hauteur, le divin, le sacré, le surnaturel, la religion" + }, + { + "pos": "mod", + "definition": "au-dessus, sur, supérieur, élevé, religieux, formel qui inspire le respect ou la crainte" + } + ] + }, + { + "word": "wan", + "definitions": [ + { + "pos": "mod", + "definition": "un, unique" + }, + { + "pos": "n", + "definition": "une unité, un élément, une particule, une partie, un morceau" + }, + { + "pos": "vt", + "definition": "unir, faire un" + } + ] + }, + { + "word": "mama", + "definitions": [ + { + "pos": "n", + "definition": "un parent, un ancêtre, un créateur, celui ou celle qui prend soin" + }, + { + "pos": "mod", + "definition": "parental, maternel, paternel" + } + ] + } + ] + }, + { + "lesson": "Questions et Réponses", + "words": [ + { + "word": "ilo", + "definitions": [ + { + "pos": "n", + "definition": "un outil, un instrument, une machine, un appareil" + } + ] + }, + { + "word": "kala", + "definitions": [ + { + "pos": "n", + "definition": "poisson, créature aquatique" + } + ] + }, + { + "word": "ona", + "definitions": [ + { + "pos": "n", + "definition": "il(s), elle(s)" + }, + { + "pos": "mod", + "definition": "son, sa, ses, leur(s)" + } + ] + }, + { + "word": "anu", + "definitions": [ + { + "pos": "conj", + "definition": "ou" + } + ] + }, + { + "word": "seme", + "definitions": [ + { + "pos": "oth", + "definition": "quoi?, quel?, lequel?, q- (mot interrogatif)" + } + ] + } + ] + }, + { + "lesson": "Prépositions", + "words": [ + { + "word": "pana", + "definitions": [ + { + "pos": "vt", + "definition": "donner, envoyer, mettre, fournir, lâcher, libérer" + }, + { + "pos": "n", + "definition": "un don, un cadeau" + } + ] + }, + { + "word": "tawa", + "definitions": [ + { + "pos": "extra", + "definition": "pre à, allant à afin de, vers, pour, jusqu'à, du point de vue de" + }, + { + "pos": "vi", + "definition": "aller à, marcher, voyager, bouger, partir" + }, + { + "pos": "n", + "definition": "le déplacement, le transport" + }, + { + "pos": "mod", + "definition": "en mouvement, animé" + }, + { + "pos": "vt", + "definition": "déplacer" + } + ] + }, + { + "word": "lon", + "definitions": [ + { + "pos": "prep", + "definition": "à, situé à, , dans, sur, réel, vrai, actuel, là" + }, + { + "pos": "vi", + "definition": "être là, être present, être vrai, exister, être éveillé" + } + ] + }, + { + "word": "kepeken", + "definitions": [ + { + "pos": "prep", + "definition": "avec, à l'aide de" + } + ] + }, + { + "word": "tan", + "definitions": [ + { + "pos": "prep", + "definition": "de, provenant de, à cause de" + }, + { + "pos": "n", + "definition": "l'origine, la cause" + } + ] + } + ] + }, + { + "lesson": "Noms Propres", + "words": [ + { + "word": "ma", + "definitions": [ + { + "pos": "n", + "definition": "une terre, un sol, le monde, un lieu en pleine air, un pays, un territoire" + } + ] + }, + { + "word": "nasin", + "definitions": [ + { + "pos": "n", + "definition": "un chemin, une voie, une manière, une façon, une coutume, une méthode, une route, une doctrine, un système" + } + ] + }, + { + "word": "nena", + "definitions": [ + { + "pos": "n", + "definition": "le nez, une bosse, une colline, une montagne, un bouton" + } + ] + }, + { + "word": "nimi", + "definitions": [ + { + "pos": "n", + "definition": "un mot, un nom" + } + ] + }, + { + "word": "utala", + "definitions": [ + { + "pos": "n", + "definition": "un conflit, une compétition, une bagarre, une guerre, une attaque, un coup, une dispute, une violence physique ou verbale" + }, + { + "pos": "vt", + "definition": "frapper, attaquer, concurrencer, se battre contre, lutter contre" + } + ] + } + ] + }, + { + "lesson": "Salutations et Sentiments", + "words": [ + { + "word": "a", + "definitions": [ + { + "pos": "interj", + "definition": "ah ! (exclamatif), (accent ou confirmation)" + } + ] + }, + { + "word": "mu", + "definitions": [ + { + "pos": "interj", + "definition": "ouaf! miaou! (cri ou communication d'animal mignon)" + } + ] + }, + { + "word": "o", + "definitions": [ + { + "pos": "sep", + "definition": "Ô ! (vocatif or imperatif)" + }, + { + "pos": "interj", + "definition": "hé! (voulant l'attention de qqun)" + } + ] + }, + { + "word": "pilin", + "definitions": [ + { + "pos": "n", + "definition": "les sentiments, les émotions, le cœur (physique ou psychologique)" + }, + { + "pos": "mod", + "definition": "qui ressent (une émotion ou une expérience directe)" + }, + { + "pos": "vi", + "definition": "sentir" + } + ] + } + ] + }, + { + "lesson": "pi", + "words": [ + { + "word": "kasi", + "definitions": [ + { + "pos": "n", + "definition": "une plante, de l'herbe, un arbre, du bois, de la végétation" + } + ] + }, + { + "word": "sijelo", + "definitions": [ + { + "pos": "n", + "definition": "le corps, l'état physique, le torse" + } + ] + }, + { + "word": "suno", + "definitions": [ + { + "pos": "n", + "definition": "le soleil, la lumière, une lueur" + }, + { + "pos": "mod", + "definition": "brillant" + } + ] + }, + { + "word": "tenpo", + "definitions": [ + { + "pos": "n", + "definition": "le temps, la durée, un moment, une occasion, une période, une situation" + } + ] + }, + { + "word": "awen", + "definitions": [ + { + "pos": "vi", + "definition": "rester, continuer" + }, + { + "pos": "vt", + "definition": "garder, attendre" + }, + { + "pos": "mod", + "definition": "resté, protégé, gardé, qui attend, qui persiste," + } + ] + }, + { + "word": "tawa", + "definitions": [ + { + "pos": "extra", + "definition": "pre à, allant à afin de, vers, pour, jusqu'à, du point de vue de" + }, + { + "pos": "vi", + "definition": "aller à, marcher, voyager, bouger, partir" + }, + { + "pos": "n", + "definition": "le déplacement, le transport" + }, + { + "pos": "mod", + "definition": "en mouvement, animé" + }, + { + "pos": "vt", + "definition": "déplacer" + } + ] + }, + { + "word": "pi", + "definitions": [ + { + "pos": "sep", + "definition": "de" + } + ] + } + ] + }, + { + "lesson": "Nombres", + "words": [ + { + "word": "ala", + "definitions": [ + { + "pos": "mod", + "definition": "non, ne...pas, aucun, rien, zéro" + }, + { + "pos": "n", + "definition": "la négation" + }, + { + "pos": "interj", + "definition": "non !" + } + ] + }, + { + "word": "wan", + "definitions": [ + { + "pos": "mod", + "definition": "un, unique" + }, + { + "pos": "n", + "definition": "une unité, un élément, une particule, une partie, un morceau" + }, + { + "pos": "vt", + "definition": "unir, faire un" + } + ] + }, + { + "word": "tu", + "definitions": [ + { + "pos": "mod", + "definition": "deux" + }, + { + "pos": "n", + "definition": "un duo, une paire" + }, + { + "pos": "vt", + "definition": "doubler, séparer/couper/diviser en deux" + } + ] + }, + { + "word": "mute", + "definitions": [ + { + "pos": "mod", + "definition": "beaucoup, plusieurs, nombreux, plus" + }, + { + "pos": "n", + "definition": "une quantité" + } + ] + }, + { + "word": "ale", + "definitions": [ + { + "pos": "n", + "definition": "l'abondance, la vie, l'univers, l'infini" + }, + { + "pos": "mod", + "definition": "tous, tout" + } + ] + } + ] + }, + { + "lesson": "Pré-Verbes", + "words": [ + { + "word": "kama", + "definitions": [ + { + "pos": "vi", + "definition": "venir, devenir, succéder, arriver, réussir à, commencer à, poursuivre des actions dans le but de" + }, + { + "pos": "n", + "definition": "l'arrivée, le début, le futur" + }, + { + "pos": "mod", + "definition": "qui arrive, qui vient, futur, venu" + }, + { + "pos": "vt", + "definition": "provoquer, convoquer" + } + ] + }, + { + "word": "ken", + "definitions": [ + { + "pos": "vi", + "definition": "pouvoir" + }, + { + "pos": "n", + "definition": "la possibilité, la capacité, la permission" + }, + { + "pos": "vt", + "definition": "permettre, être capable de, être autorisé à" + }, + { + "pos": "cont", + "definition": "il est possible que" + } + ] + }, + { + "word": "wile", + "definitions": [ + { + "pos": "vt", + "definition": "vouloir, avoir besoin, souhaiter" + }, + { + "pos": "n", + "definition": "le désir, le besoin, la volonté" + }, + { + "pos": "mod", + "definition": "nécessaire" + } + ] + }, + { + "word": "lukin", + "definitions": [ + { + "pos": "vt", + "definition": "voir, regarder, lire" + }, + { + "pos": "vi", + "definition": "regarder, faire attention, surveiller, observer, examiner" + }, + { + "pos": "mod", + "definition": "visuellement" + } + ] + }, + { + "word": "sona", + "definitions": [ + { + "pos": "n", + "definition": "la connaissance, la sagesse, l'intelligence, la compréhension, le savoir" + }, + { + "pos": "vt", + "definition": "savoir, comprendre, savoir comment" + }, + { + "pos": "vi", + "definition": "savoir, comprendre" + }, + { + "pos": "kama", + "definition": "apprendre, étudier" + } + ] + }, + { + "word": "kama", + "definitions": [ + { + "pos": "vi", + "definition": "venir, devenir, succéder, arriver, réussir à, commencer à, poursuivre des actions dans le but de" + }, + { + "pos": "n", + "definition": "l'arrivée, le début, le futur" + }, + { + "pos": "mod", + "definition": "qui arrive, qui vient, futur, venu" + }, + { + "pos": "vt", + "definition": "provoquer, convoquer" + } + ] + }, + { + "word": "lukin", + "definitions": [ + { + "pos": "vt", + "definition": "voir, regarder, lire" + }, + { + "pos": "vi", + "definition": "regarder, faire attention, surveiller, observer, examiner" + }, + { + "pos": "mod", + "definition": "visuellement" + } + ] + } + ] + }, + { + "lesson": "Couleurs et la", + "words": [ + { + "word": "jelo", + "definitions": [ + { + "pos": "mod", + "definition": "jaune (ou approchant), vert clair" + } + ] + }, + { + "word": "laso", + "definitions": [ + { + "pos": "mod", + "definition": "bleu, vert" + } + ] + }, + { + "word": "loje", + "definitions": [ + { + "pos": "mod", + "definition": "rouge" + } + ] + }, + { + "word": "pimeja", + "definitions": [ + { + "pos": "mod", + "definition": "noir, foncé, sombre" + }, + { + "pos": "n", + "definition": "l'obscurité, une ombre" + }, + { + "pos": "vt", + "definition": "assombrir" + } + ] + }, + { + "word": "walo", + "definitions": [ + { + "pos": "mod", + "definition": "blanc, pâle, clair (couleur)" + }, + { + "pos": "n", + "definition": "une chose blanche, une blancheur, une légèreté" + } + ] + }, + { + "word": "la", + "definitions": [ + { + "pos": "sep", + "definition": "(entre le contexte et la phrase principale)" + } + ] + } + ] + }, + { + "lesson": "Noms Spatiaux", + "words": [ + { + "word": "insa", + "definitions": [ + { + "pos": "n", + "definition": "le centre, le contenu, l'intérieur, l'estomac" + }, + { + "pos": "mod", + "definition": "intérieur, central, entre" + } + ] + }, + { + "word": "monsi", + "definitions": [ + { + "pos": "n", + "definition": "le dos, le derrière, l'arrière" + }, + { + "pos": "mod", + "definition": "arrière" + } + ] + }, + { + "word": "noka", + "definitions": [ + { + "pos": "n", + "definition": "un pied, une jambe, l'organe de locomotion" + } + ] + }, + { + "word": "poka", + "definitions": [ + { + "pos": "n", + "definition": " un coté, une proximité, la hanche" + }, + { + "pos": "prep", + "definition": "accompagner de" + }, + { + "pos": "mod", + "definition": "voisin" + } + ] + }, + { + "word": "sewi", + "definitions": [ + { + "pos": "n", + "definition": "chose élevée ; la hauteur, le divin, le sacré, le surnaturel, la religion" + }, + { + "pos": "mod", + "definition": "au-dessus, sur, supérieur, élevé, religieux, formel qui inspire le respect ou la crainte" + } + ] + }, + { + "word": "sinpin", + "definitions": [ + { + "pos": "n", + "definition": "le devant, l'avant, la poitrine, le torse, le visage, le mur" + } + ] + } + ] + }, + { + "lesson": "Particules et Perspective", + "words": [ + { + "word": "anpa", + "definitions": [ + { + "pos": "n", + "definition": "le fond, le sol, le bas" + }, + { + "pos": "mod", + "definition": "bas, humble, vers le bas, qui dépend" + }, + { + "pos": "vt", + "definition": "vaincre, abaisser" + }, + { + "pos": "vi", + "definition": "se prosterner" + } + ] + }, + { + "word": "ante", + "definitions": [ + { + "pos": "n", + "definition": "la différence" + }, + { + "pos": "mod", + "definition": "différent, changé, autre" + }, + { + "pos": "conj", + "definition": "sinon" + }, + { + "pos": "vt", + "definition": "changer, modifier" + } + ] + }, + { + "word": "en", + "definitions": [ + { + "pos": "conj", + "definition": "et (utilisé entre plusieurs sujets)" + } + ] + }, + { + "word": "lete", + "definitions": [ + { + "pos": "n", + "definition": "le froid" + }, + { + "pos": "mod", + "definition": "froid, frais, cru" + }, + { + "pos": "vt", + "definition": "refroidir" + } + ] + }, + { + "word": "lupa", + "definitions": [ + { + "pos": "n", + "definition": "un trou, un orifice, une fenêtre, une porte" + } + ] + }, + { + "word": "open", + "definitions": [ + { + "pos": "vt", + "definition": "commencer, ouvrir, allumer" + } + ] + }, + { + "word": "sama", + "definitions": [ + { + "pos": "mod", + "definition": "même, semblable, l'un l'autre, fraternel, homologue" + }, + { + "pos": "prep", + "definition": "comme" + } + ] + }, + { + "word": "suwi", + "definitions": [ + { + "pos": "n", + "definition": "des bonbons, des aliments sucrés" + }, + { + "pos": "mod", + "definition": "doux, mignon, parfumé, innocent, adorable" + }, + { + "pos": "vt", + "definition": "adoucir" + } + ] + }, + { + "word": "taso", + "definitions": [ + { + "pos": "mod", + "definition": "seulement, uniquement" + }, + { + "pos": "conj", + "definition": "mais, cependant" + } + ] + }, + { + "word": "tawa", + "definitions": [ + { + "pos": "extra", + "definition": "pre à, allant à afin de, vers, pour, jusqu'à, du point de vue de" + }, + { + "pos": "vi", + "definition": "aller à, marcher, voyager, bouger, partir" + }, + { + "pos": "n", + "definition": "le déplacement, le transport" + }, + { + "pos": "mod", + "definition": "en mouvement, animé" + }, + { + "pos": "vt", + "definition": "déplacer" + } + ] + } + ] + }, + { + "lesson": "Aventure de Chasse", + "words": [ + { + "word": "alasa", + "definitions": [ + { + "pos": "vt", + "definition": "chasser, cueillir" + } + ] + }, + { + "word": "lawa", + "definitions": [ + { + "pos": "n", + "definition": "la tête, le mental" + }, + { + "pos": "mod", + "definition": "principal, dirigeant" + }, + { + "pos": "vt", + "definition": "dominer, diriger, guider, mener, contrôler" + } + ] + }, + { + "word": "len", + "definitions": [ + { + "pos": "n", + "definition": "le tissu, les vêtements, le textile, une couverture" + } + ] + }, + { + "word": "linja", + "definitions": [ + { + "pos": "n", + "definition": "objet long et flexible ; une corde, un cheveu, un fil, une ligne" + } + ] + }, + { + "word": "pakala", + "definitions": [ + { + "pos": "n", + "definition": "accident, erreur, destruction, dommage, rupture" + }, + { + "pos": "vt", + "definition": "bousiller, bâcler, ruiner, casser, blesser" + }, + { + "pos": "vi", + "definition": "s'effondrer, casser," + }, + { + "pos": "interj", + "definition": "putain!, merde!" + } + ] + }, + { + "word": "palisa", + "definitions": [ + { + "pos": "n", + "definition": "objet long et dur ; tige, bâton, branche" + } + ] + }, + { + "word": "pipi", + "definitions": [ + { + "pos": "n", + "definition": "un insecte, une araignée, une fourmi" + } + ] + }, + { + "word": "waso", + "definitions": [ + { + "pos": "n", + "definition": "un oiseau, une créatue volante, un animal ailé" + } + ] + }, + { + "word": "weka", + "definitions": [ + { + "pos": "mod", + "definition": "absent, manquant, éloigné" + }, + { + "pos": "n", + "definition": "une absence" + }, + { + "pos": "vt", + "definition": "jeter, enlever, se débarrasser de, éloigner" + } + ] + } + ] + }, + { + "lesson": "Aventure de cuisine", + "words": [ + { + "word": "lape", + "definitions": [ + { + "pos": "n", + "definition": "le repos" + }, + { + "pos": "vi", + "definition": "dormir" + }, + { + "pos": "mod", + "definition": "dormant" + } + ] + }, + { + "word": "olin", + "definitions": [ + { + "pos": "n", + "definition": "l'amour" + }, + { + "pos": "mod", + "definition": "aimé" + }, + { + "pos": "vt", + "definition": "aimer, respecter, compatir" + } + ] + }, + { + "word": "pan", + "definitions": [ + { + "pos": "n", + "definition": "des céréales, du riz, du blé, de l'orge, du maïs, de l'avoine, du pain, des pâtes" + } + ] + }, + { + "word": "pini", + "definitions": [ + { + "pos": "n", + "definition": "la fin" + }, + { + "pos": "mod", + "definition": "fin, passé, completé" + }, + { + "pos": "vt", + "definition": "finir, fermer, éteindre" + } + ] + }, + { + "word": "seli", + "definitions": [ + { + "pos": "n", + "definition": "le feu, un élément de cuisson, une réaction chimique, la chaleur" + }, + { + "pos": "mod", + "definition": "chaud, cuit" + }, + { + "pos": "vt", + "definition": "chauffer, réchauffer, cuire" + } + ] + }, + { + "word": "supa", + "definitions": [ + { + "pos": "n", + "definition": "une surface horizontale sur laquelle on peut posé qqch ; un meuble, une table, une chaise, un oreiller, le sol" + } + ] + }, + { + "word": "uta", + "definitions": [ + { + "pos": "n", + "definition": "la cavité buccale, la bouche, les lèvres, la mâchoire" + }, + { + "pos": "mod", + "definition": "oral" + } + ] + }, + { + "word": "telo", + "definitions": [ + { + "pos": "n", + "definition": "l'eau, un liquide, un fluide, une substance mouillé, une boission" + }, + { + "pos": "vt", + "definition": "laver avec de l'eau" + } + ] + }, + { + "word": "seli", + "definitions": [ + { + "pos": "n", + "definition": "le feu, un élément de cuisson, une réaction chimique, la chaleur" + }, + { + "pos": "mod", + "definition": "chaud, cuit" + }, + { + "pos": "vt", + "definition": "chauffer, réchauffer, cuire" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/db/dataset_fr/toki-partsofspeech.json b/db/dataset_fr/toki-partsofspeech.json new file mode 100644 index 0000000..88075d9 --- /dev/null +++ b/db/dataset_fr/toki-partsofspeech.json @@ -0,0 +1,46 @@ +[ + { + "pos": "n", + "definition": "nom principal" + }, + { + "pos": "mod", + "definition": "modificateur (adjectif ou adverbe)" + }, + { + "pos": "sep", + "definition": "séparateur" + }, + { + "pos": "vt", + "definition": "verbe transitif (généralement utilisé avec \"e\")" + }, + { + "pos": "vi", + "definition": "verbe intransitif" + }, + { + "pos": "interj", + "definition": "interjection" + }, + { + "pos": "prep", + "definition": "quasi-préposition" + }, + { + "pos": "conj", + "definition": "conjonction" + }, + { + "pos": "kama", + "definition": "verbe composé précédé de \"kama\"" + }, + { + "pos": "cont", + "definition": "mot de contexte utilisé avant \"la\"" + }, + { + "pos": "oth", + "definition": "mot spécial, autre" + } +] \ No newline at end of file diff --git a/lib/tasks/database.rake b/lib/tasks/database.rake index 06f3628..c1822b6 100644 --- a/lib/tasks/database.rake +++ b/lib/tasks/database.rake @@ -1,30 +1,33 @@ namespace :dataset do desc "TODO" task ingest: :environment do - english = create_english_lang - ingest_pos(english) - ingest_dictionary(english) + english = create_language('English') + ingest_pos(english, 'dataset_en') + ingest_dictionary(english, 'dataset_en') + french = create_language('French') + ingest_pos(french, 'dataset_fr') + ingest_dictionary(french, 'dataset_fr') puts "Ingest complete." end end -def create_english_lang - if Language.count > 0 - puts "Language English already exists! Skipping step." +def create_language(name) + if Language.where(name: name).count > 0 + puts "Language #{name} already exists! Skipping step." return end - return Language.create(name: "English") + return Language.create(name: name) end -def ingest_pos(language) - if PartOfSpeech.count > 0 +def ingest_pos(language, dataset) + if PartOfSpeech.where(language_id: language.id).count > 0 puts "Parts of speech data already exists in table! Aborting." return end - parts_of_speech = JSON.parse(File.read('db/dataset_en/toki-partsofspeech.json')) + parts_of_speech = JSON.parse(File.read("db/#{dataset}/toki-partsofspeech.json")) parts_of_speech.each do |pos| PartOfSpeech.create(pos: pos['pos'], definition: pos['definition'], language_id: language.id) @@ -32,19 +35,24 @@ def ingest_pos(language) puts "Parts of speech ingest complete." end -def ingest_dictionary(language) - if Word.count > 0 - puts "Dictionary data already exists in table! Aborting." +def ingest_dictionary(language, dataset) + if Definition.where(language_id: language.id).count > 0 + puts "Dictionary data for this language already exists in table! Aborting." return end - dictionary = JSON.parse(File.read('db/dataset_en/toki-dictionary.json')) + dictionary = JSON.parse(File.read("db/#{dataset}/toki-dictionary.json")) dictionary.each do |entry| if entry['word'] == "a" puts entry end - word = Word.create(word: entry['word']) + #word = Word.create(word: entry['word']) + word = Word.where(word: entry['word']).first + + if word.nil? + word = Word.create(word: entry['word']) + end entry['definitions'].each do |definition| word.definitions.create(pos: definition['pos'], definition: definition['definition'], language_id: language.id) diff --git a/spec/controllers/words_spec.rb b/spec/controllers/words_spec.rb deleted file mode 100644 index 3881197..0000000 --- a/spec/controllers/words_spec.rb +++ /dev/null @@ -1,22 +0,0 @@ -require 'rails_helper' - -RSpec.describe WordsController, type: :controller do - describe "GET :index" do - it 'renders the index template' do - get :index - expect(response).to render_template(:index) - end - - it 'sets @words instance variable' do - FactoryBot.create(:word) - get :index - expect(assigns(:words)).to be_a(ActiveRecord::Relation) - end - - it 'fetches all words into @words' do - 5.times { FactoryBot.create(:word) } - get :index - expect(assigns(:words).count).to eq(5) - end - end -end diff --git a/spec/factories/part_of_speech.rb b/spec/factories/part_of_speech.rb index a38a5d7..17378c9 100644 --- a/spec/factories/part_of_speech.rb +++ b/spec/factories/part_of_speech.rb @@ -1,7 +1,7 @@ FactoryBot.define do factory :part_of_speech do sequence(:pos) { |n| "test-#{n.to_s}" } - language_id { FactoryBot.create(:language).id } + language_id { FactoryBot.create(:language_english).id } definition { "test definition" } end end diff --git a/spec/helpers/active_language_helper_spec.rb b/spec/helpers/active_language_helper_spec.rb index ddc53c3..b2c3be7 100644 --- a/spec/helpers/active_language_helper_spec.rb +++ b/spec/helpers/active_language_helper_spec.rb @@ -23,10 +23,6 @@ RSpec.describe ActiveLanguageHelper, type: :helper do expect(@tag).to have_selector(%(select)) end - it "should not contain an English option" do - expect(@tag).to_not include("English") - end - it "should include css id #active_language_select_tag" do expect(@tag).to have_selector(%(select[id="active_language_select_tag"])) end diff --git a/spec/requests/dictionary_spec.rb b/spec/requests/dictionary_spec.rb index 266332d..13c3ec0 100644 --- a/spec/requests/dictionary_spec.rb +++ b/spec/requests/dictionary_spec.rb @@ -14,6 +14,7 @@ RSpec.describe "Dictionary", type: :request do it "shows the count of parts of speech in the database" do 5.times { FactoryBot.create(:part_of_speech) } + #puts PartOfSpeech.count get "/dictionary" expect(response.body).to include("#{PartOfSpeech.count} parts of speech entries in database") end diff --git a/spec/requests/language_spec.rb b/spec/requests/language_spec.rb deleted file mode 100644 index 64b626d..0000000 --- a/spec/requests/language_spec.rb +++ /dev/null @@ -1,106 +0,0 @@ -require 'rails_helper' - -RSpec.describe "Languages", type: :request do - - describe "GET :index" do - it "returns http success" do - get "/admin/languages/" - expect(response).to have_http_status(:success) - end - - it "lists all languages" do - language = FactoryBot.create(:language) - get "/admin/languages/" - expect(response.body).to include(language.name) - end - - it "has a new-language link" do - get "/admin/languages/" - expect(response.body).to have_selector(%(a[href="#{new_admin_language_path}"])) - end - - it "has an edit button" do - language = FactoryBot.create(:language) - get "/admin/languages/" - expect(response.body).to have_link("Edit") - end - - it "has a delete button" do - language = FactoryBot.create(:language) - get "/admin/languages/" - expect(response.body).to have_link("Delete") - end - end - - describe "GET :new" do - it "returns http success" do - get "/admin/languages/new" - expect(response).to have_http_status(:success) - end - - it "has a form for a new language" do - get "/admin/languages/new" - expect(response.body).to have_selector(%(input[name="language[name]"])) - end - end - - describe "POST :create" do - it "redirect to admin_languages_path on success" do - post "/admin/languages", params: { language: { name: "Test Name" } } - expect(response).to redirect_to(admin_languages_path) - end - - it "creates a new language" do - post "/admin/languages", params: { language: { name: "Test Name" } } - expect(Language.count).to eq(1) - end - - it "requires a name for a new language" do - post "/admin/languages", params: { language: { name: nil } } - expect(response).to have_http_status(:unprocessable_entity) - end - end - - describe "GET :edit" do - before :each do - @language = FactoryBot.create(:language) - get "/admin/languages/#{@language.id}/edit" - end - - it "returns http success" do - expect(response).to have_http_status(:success) - end - - it "has a form to edit language" do - expect(response.body).to have_selector(%(input[name="language[name]"])) - end - end - - describe "PATCH :update" do - before :each do - @language = FactoryBot.create(:language) - @params = { language: { name: "Test Name Update" } } - end - - it "updates a language" do - patch "/admin/languages/#{@language.id}", params: @params - expect(response).to redirect_to(admin_languages_path) - end - - it "requires params to update a language" do - @params = { language: { name: nil, invalid: "oh no" } } - patch "/admin/languages/#{@language.id}", params: @params - expect(response).to have_http_status(:unprocessable_entity) - end - - end - - describe "DELETE :destroy" do - it "deletes a language" do - language = FactoryBot.create(:language) - language2 = FactoryBot.create(:language) - delete "/admin/languages/#{language.id}" - expect(Language.all).to eq([language2]) - end - end -end diff --git a/spec/requests/root_spec.rb b/spec/requests/root_spec.rb index a9b810c..9d71e55 100644 --- a/spec/requests/root_spec.rb +++ b/spec/requests/root_spec.rb @@ -13,38 +13,8 @@ RSpec.describe "Root path", type: :request do end end - describe "logged out" do - it "should have 'Register' link" do - get root_path - expect(response.body).to include("Register") - end - end - - describe "logged in" do - it "should have 'Sign Out' link" do - sign_in FactoryBot.create(:user) - get root_path - expect(response.body).to include("Sign Out") - end - - it "should have the 'Languages' link" do - sign_in FactoryBot.create(:user) - get root_path - expect(response.body).to have_selector(%(a[href="#{admin_languages_path}"])) - end - - it "should welcome user by username" do - user = FactoryBot.create(:user) - sign_in user - get root_path - expect(response.body).to include(user.username) - end - - it "should have a language drop-down" do - user = FactoryBot.create(:user) - sign_in user - get root_path - expect(response.body).to have_field("active_language_id") - end + it "should have a language drop-down" do + get root_path + expect(response.body).to have_field("active_language_id") end end diff --git a/spec/requests/word_spec.rb b/spec/requests/word_spec.rb deleted file mode 100644 index 77ed5dd..0000000 --- a/spec/requests/word_spec.rb +++ /dev/null @@ -1,39 +0,0 @@ -require 'rails_helper' - -RSpec.describe "Words", type: :request do - describe "GET /index" do - - it "renders the index template" do - get "/words" - expect(response).to render_template(:index) - end - end - - describe "GET /show/:val" do - - before(:each) do - @word = FactoryBot.create(:word) - end - - it "renders the show template" do - get "/words/#{@word.id}" - expect(response).to render_template(:show) - end - - it "sets @word instance variable" do - get "/words/#{@word.id}" - expect(assigns(:word)).to be_a(Word) - end - - it "displays the word name" do - get "/words/#{@word.id}" - expect(response.body).to include(@word.word) - end - - it "displays the definitions" do - @definition = FactoryBot.create(:definition) - get "/words/#{@definition.word_id}" - expect(response.body).to include(@definition.definition) - end - end -end