Module sheldon_dictionary

This gen_server only creates the ets for the dictionary and ets for bazingas.

Copyright © Inaka <hello@inaka.net>

Behaviours: gen_server.

Description

This gen_server only creates the ets for the dictionary and ets for bazingas.

Copyright 2016 Inaka <hello@inaka.net>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Data Types

language()

language() = eng

Function Index

code_change/3
dictionary_name/1returns the name of the dictionary given the language() as a parameter.
get_bazinga/1returns a bazinga from the ETS.
handle_call/3
handle_cast/2
handle_info/2
init/1
member/2evaluates if a given string() is member of the dictionary.
start_link/1starts the gen_server.
terminate/2

Function Details

code_change/3

code_change(OldVsn::term() | {down, term()}, State, Extra::term()) -> {ok, State}

dictionary_name/1

dictionary_name(Lang::language()) -> atom()

returns the name of the dictionary given the language() as a parameter

get_bazinga/1

get_bazinga(Lang::language()) -> string()

returns a bazinga from the ETS

handle_call/3

handle_call(Request::term(), From::{pid(), Tag::term()}, State) -> {reply, ok, State}

handle_cast/2

handle_cast(Request::term(), State) -> {noreply, State}

handle_info/2

handle_info(Info::timeout() | term(), State) -> {noreply, State}

init/1

init(X1::[language()]) -> {ok, State::#{}}

member/2

member(Word::string(), Lang::language()) -> boolean()

evaluates if a given string() is member of the dictionary

start_link/1

start_link(Lang::language()) -> {ok, Pid::pid()} | ignore | {error, Reason::term()}

starts the gen_server

terminate/2

terminate(Reason::normal | shutdown | {shutdown, term()} | term(), State::#{}) -> term()


Generated by EDoc, Sep 30 2016, 14:42:01.