FormalLanguagesRoutines

所属分类:编程语言基础
开发工具:Java
文件大小:0KB
下载次数:0
上传日期:2021-11-28 21:23:23
上 传 者sh-1993
说明:  一个集中式中心,包含用于自定义语法派生、生成和解释的程序。
(A centralized hub containing programs for custom grammar derivation, generation and interpretation.)

文件列表:
.idea/ (0, 2021-11-28)
.idea/codeStyles/ (0, 2021-11-28)
.idea/codeStyles/Project.xml (263, 2021-11-28)
.idea/codeStyles/codeStyleConfig.xml (149, 2021-11-28)
.idea/description.html (97, 2021-11-28)
.idea/encodings.xml (159, 2021-11-28)
.idea/libraries/ (0, 2021-11-28)
.idea/libraries/lib.xml (363, 2021-11-28)
.idea/misc.xml (491, 2021-11-28)
.idea/modules.xml (284, 2021-11-28)
.idea/project-template.xml (89, 2021-11-28)
.idea/runConfigurations.xml (337, 2021-11-28)
.idea/uiDesigner.xml (8792, 2021-11-28)
.idea/vcs.xml (180, 2021-11-28)
FormalLanguageRoutines.iml (484, 2021-11-28)
src/ (0, 2021-11-28)
src/com/ (0, 2021-11-28)
src/com/hammersoft/ (0, 2021-11-28)
src/com/hammersoft/formal_languages/ (0, 2021-11-28)
src/com/hammersoft/formal_languages/Main.java (762, 2021-11-28)
src/com/hammersoft/formal_languages/ProgramFactory.java (2485, 2021-11-28)
src/com/hammersoft/formal_languages/ProgramType.java (578, 2021-11-28)
src/com/hammersoft/formal_languages/file_handler/ (0, 2021-11-28)
src/com/hammersoft/formal_languages/file_handler/FileHandler.java (1519, 2021-11-28)
src/com/hammersoft/formal_languages/file_handler/FileManager.java (198, 2021-11-28)
src/com/hammersoft/formal_languages/language_programs/ (0, 2021-11-28)
src/com/hammersoft/formal_languages/language_programs/AFD.java (4039, 2021-11-28)
src/com/hammersoft/formal_languages/language_programs/AFD_Transition.java (1437, 2021-11-28)
src/com/hammersoft/formal_languages/language_programs/AFD_TransitionFunction.java (2019, 2021-11-28)
src/com/hammersoft/formal_languages/language_programs/Gramatica.java (8236, 2021-11-28)
src/com/hammersoft/formal_languages/language_programs/Markov.java (4116, 2021-11-28)
src/com/hammersoft/formal_languages/language_programs/Program.java (89, 2021-11-28)
src/com/hammersoft/formal_languages/language_programs/builder_helpers/ (0, 2021-11-28)
src/com/hammersoft/formal_languages/language_programs/builder_helpers/AFDBuilderHelper.java (2148, 2021-11-28)
src/com/hammersoft/formal_languages/language_programs/builder_helpers/Builder.java (193, 2021-11-28)
src/com/hammersoft/formal_languages/language_programs/builder_helpers/GramaticaBuilderHelper.java (2749, 2021-11-28)
src/com/hammersoft/formal_languages/language_programs/builder_helpers/MarkovBuilderHelper.java (1673, 2021-11-28)
... ...

# FormalLanguagesRoutines A centralized hub containing programs for custom grammar derivation, generation and interpretation. The application features dedicated console GUIs for each subroutine (programs) contained. The application implements the factory creational design pattern for handling a variable number of subroutines, as well as builder design pattern for initializing the data model for each of it's subroutine in a final (get-only) state, in accordance with the proper object-oriented practices. Additionaly, each specialized view implements a baseline view interface, which is extended to accomodate the different options that each subroutine requires for the proper testing of its features. Specialised views are imnplemented as lasy singletons, due to only requiring one unique instance for each subroutine, if and only if that subroutine exists and has been properly initialised. The factory class is also a singleton, eager initialisation type, due to always requiring one unique instance whenever the Main method is ran. The factory design pattern allows us to quickly test different implementations of methods used in the creation process and handling of the subroutines, as well as providing a sistematic logical way of expanding the master program functionality with additional subroutines. The builder design patterns helps divide the complexity of the primary class from each subroutine into 2 smaller modules, each having its own responsibility (the data-containing class and builder class). The subroutines core class constructor is private, and only accessible by the builder, which together with the subroutine-unique helpers (working as a bridge between builders and fileHandlers), constructs each subroutine with the corresponding data properly formatted for that subroutine by the implemented fileManager. ## CURRENT AVAILABLE SUBROUTINES: ### I. Markov Derivator program: Un algoritm normal in sens Markov este un sistem de rescriere SR = (V,F) unde elementele lui F sunt date intr-o anumita ordine si exista o submultime, posibil vida, F1 ≤ F continand reguli sau productii finale. La fiecare pas al algoritmului se aplica prima dintre regulile lui F care este aplicabila, si in plus se rescrie cea mai din stanga aparitie a subcuvantului care este membru stang al regulii folosite. - marcheaza finalul - executarea multipla a unui pas Implementare algoritm normal in sens Markov: - Se citesc din fisier componentele (vocabularul si regulile de rescriere); - Se citeste de la tastatura un cuvant, se deriveaza pe baza algoritmului (se deriveaza pana se aplica o regula finala sau nu mai exista reguli aplicabile), se afiseaza cuvantul obtinut, apoi utilizatorul este intrebat daca mai doreste testarea unui cuvant si in caz afirmativ se reia procesul; Metode subrutina: 1. citire() 2. afisare() 3. derivare(propozitie) ### II. Generative grammar program: Implmentare gramatica generativa: se citesc din fiier elementele componente VN, VT, simbolul de start i produciile (regulile de generare). Se citete de la tastatur un numr n, iar apoi se genereaz n cuvinte n gramatic. Generarea are loc n modul urmtor: se pornete de fiecare dat de la simbolul de start. Ct timp exist producii aplicabile se aplic random una dintre produciile aplicabile. Conditii verificare: 1. VN intersects VT = empty set 2. S is part of VN 3. for each rule, the left member has at least one non-terminal 4. there is at least one production with start suymbol S as the sole left member 5. each production contain only elements found over the VN and VT alphabets Metode subrutina: 1. citire() 2. verificare() 3. afisare() 4. generare() ### III. Finite deterministic automaton program: Un AFD este este un 5-uplu A=(Q, Σ, δ, q0, F), in care: Q este o multime finita de stari Σ este o multime finita de simboli de intrare (alfabet simboluri de intrare) δ este o functie de tranzitie: δ:Q × Σ -> Q q0 este starea initiala F este o multime de stari finale. Implementare AFD (automat finit determinist): - se citesc din fiier elementele componente ale automatului Q, Σ, δ, q0, F. - Se citete de la tastatur un cuvant i se verific, dac este acceptat de ctre automat. Metode subrutina: 1. citire() 2. afisare() 3. verificare(cuvant) ## TO-DO: - [ ] [Improve error handling and file operations](https://github.com/raduhammer/FormalLanguagesRoutines/issues/1) - [ ] [Add proper GUI using JavaFX](https://github.com/raduhammer/FormalLanguagesRoutines/issues/2) - [ ] [Add subroutine initialization files guidelines](https://github.com/raduhammer/FormalLanguagesRoutines/issues/4) - [ ] [Fix the initial commit description disaster](https://github.com/raduhammer/FormalLanguagesRoutines/issues/3) - [ ] [Create application structure flowchart](https://github.com/raduhammer/FormalLanguagesRoutines/issues/5) - [ ] I should also fix the remaining romgleza de prin README :)

近期下载者

相关文件


收藏者