JAVA all works
This commit is contained in:
202
semester-4/ОПJа/lb-1/task1/.gitignore
vendored
Normal file
202
semester-4/ОПJа/lb-1/task1/.gitignore
vendored
Normal file
@ -0,0 +1,202 @@
|
||||
/target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
|
||||
# Created by https://www.gitignore.io/api/git,java,maven,eclipse,windows
|
||||
|
||||
### Eclipse ###
|
||||
|
||||
.metadata
|
||||
bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
*.bak
|
||||
*.swp
|
||||
*~.nib
|
||||
local.properties
|
||||
.settings/
|
||||
.loadpath
|
||||
.recommenders
|
||||
|
||||
# External tool builders
|
||||
.externalToolBuilders/
|
||||
|
||||
# Locally stored "Eclipse launch configurations"
|
||||
*.launch
|
||||
|
||||
# PyDev specific (Python IDE for Eclipse)
|
||||
*.pydevproject
|
||||
|
||||
# CDT-specific (C/C++ Development Tooling)
|
||||
.cproject
|
||||
|
||||
# CDT- autotools
|
||||
.autotools
|
||||
|
||||
# Java annotation processor (APT)
|
||||
.factorypath
|
||||
|
||||
# PDT-specific (PHP Development Tools)
|
||||
.buildpath
|
||||
|
||||
# sbteclipse plugin
|
||||
.target
|
||||
|
||||
# Tern plugin
|
||||
.tern-project
|
||||
|
||||
# TeXlipse plugin
|
||||
.texlipse
|
||||
|
||||
# STS (Spring Tool Suite)
|
||||
.springBeans
|
||||
|
||||
# Code Recommenders
|
||||
.recommenders/
|
||||
|
||||
# Annotation Processing
|
||||
.apt_generated/
|
||||
|
||||
# Scala IDE specific (Scala & Java development for Eclipse)
|
||||
.cache-main
|
||||
.scala_dependencies
|
||||
.worksheet
|
||||
|
||||
### Eclipse Patch ###
|
||||
# Eclipse Core
|
||||
.project
|
||||
|
||||
# JDT-specific (Eclipse Java Development Tools)
|
||||
.classpath
|
||||
|
||||
# Annotation Processing
|
||||
.apt_generated
|
||||
|
||||
.sts4-cache/
|
||||
|
||||
### Git ###
|
||||
# Created by git for backups. To disable backups in Git:
|
||||
# $ git config --global mergetool.keepBackup false
|
||||
*.orig
|
||||
|
||||
# Created by git when using merge tools for conflicts
|
||||
*.BACKUP.*
|
||||
*.BASE.*
|
||||
*.LOCAL.*
|
||||
*.REMOTE.*
|
||||
*_BACKUP_*.txt
|
||||
*_BASE_*.txt
|
||||
*_LOCAL_*.txt
|
||||
*_REMOTE_*.txt
|
||||
|
||||
### Java ###
|
||||
# Compiled class file
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
*.log
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
||||
### Maven ###
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
### Windows ###
|
||||
# Windows thumbnail cache files
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
|
||||
# Dump file
|
||||
*.stackdump
|
||||
|
||||
# Folder config file
|
||||
[Dd]esktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Some additional ignores (sort later)
|
||||
*.DS_Store
|
||||
*.sw?
|
||||
.#*
|
||||
*#
|
||||
*~
|
||||
.classpath
|
||||
.project
|
||||
.settings
|
||||
bin
|
||||
build
|
||||
target
|
||||
dependency-reduced-pom.xml
|
||||
*.sublime-*
|
||||
/scratch
|
||||
.gradle
|
||||
README.html
|
||||
*.iml
|
||||
.idea
|
||||
.exercism
|
||||
|
202
semester-4/ОПJа/lb-2/task2/.gitignore
vendored
Normal file
202
semester-4/ОПJа/lb-2/task2/.gitignore
vendored
Normal file
@ -0,0 +1,202 @@
|
||||
/target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
|
||||
# Created by https://www.gitignore.io/api/git,java,maven,eclipse,windows
|
||||
|
||||
### Eclipse ###
|
||||
|
||||
.metadata
|
||||
bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
*.bak
|
||||
*.swp
|
||||
*~.nib
|
||||
local.properties
|
||||
.settings/
|
||||
.loadpath
|
||||
.recommenders
|
||||
|
||||
# External tool builders
|
||||
.externalToolBuilders/
|
||||
|
||||
# Locally stored "Eclipse launch configurations"
|
||||
*.launch
|
||||
|
||||
# PyDev specific (Python IDE for Eclipse)
|
||||
*.pydevproject
|
||||
|
||||
# CDT-specific (C/C++ Development Tooling)
|
||||
.cproject
|
||||
|
||||
# CDT- autotools
|
||||
.autotools
|
||||
|
||||
# Java annotation processor (APT)
|
||||
.factorypath
|
||||
|
||||
# PDT-specific (PHP Development Tools)
|
||||
.buildpath
|
||||
|
||||
# sbteclipse plugin
|
||||
.target
|
||||
|
||||
# Tern plugin
|
||||
.tern-project
|
||||
|
||||
# TeXlipse plugin
|
||||
.texlipse
|
||||
|
||||
# STS (Spring Tool Suite)
|
||||
.springBeans
|
||||
|
||||
# Code Recommenders
|
||||
.recommenders/
|
||||
|
||||
# Annotation Processing
|
||||
.apt_generated/
|
||||
|
||||
# Scala IDE specific (Scala & Java development for Eclipse)
|
||||
.cache-main
|
||||
.scala_dependencies
|
||||
.worksheet
|
||||
|
||||
### Eclipse Patch ###
|
||||
# Eclipse Core
|
||||
.project
|
||||
|
||||
# JDT-specific (Eclipse Java Development Tools)
|
||||
.classpath
|
||||
|
||||
# Annotation Processing
|
||||
.apt_generated
|
||||
|
||||
.sts4-cache/
|
||||
|
||||
### Git ###
|
||||
# Created by git for backups. To disable backups in Git:
|
||||
# $ git config --global mergetool.keepBackup false
|
||||
*.orig
|
||||
|
||||
# Created by git when using merge tools for conflicts
|
||||
*.BACKUP.*
|
||||
*.BASE.*
|
||||
*.LOCAL.*
|
||||
*.REMOTE.*
|
||||
*_BACKUP_*.txt
|
||||
*_BASE_*.txt
|
||||
*_LOCAL_*.txt
|
||||
*_REMOTE_*.txt
|
||||
|
||||
### Java ###
|
||||
# Compiled class file
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
*.log
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
||||
### Maven ###
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
### Windows ###
|
||||
# Windows thumbnail cache files
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
|
||||
# Dump file
|
||||
*.stackdump
|
||||
|
||||
# Folder config file
|
||||
[Dd]esktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Some additional ignores (sort later)
|
||||
*.DS_Store
|
||||
*.sw?
|
||||
.#*
|
||||
*#
|
||||
*~
|
||||
.classpath
|
||||
.project
|
||||
.settings
|
||||
bin
|
||||
build
|
||||
target
|
||||
dependency-reduced-pom.xml
|
||||
*.sublime-*
|
||||
/scratch
|
||||
.gradle
|
||||
README.html
|
||||
*.iml
|
||||
.idea
|
||||
.exercism
|
||||
|
@ -1,6 +1,7 @@
|
||||
package ua.nure.jfn.task2;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
public class ArrayImpl<T> implements Array<T> {
|
||||
|
||||
@ -11,10 +12,10 @@ public class ArrayImpl<T> implements Array<T> {
|
||||
}
|
||||
|
||||
public ArrayImpl(Container<T> container) {
|
||||
this.elements = new Object[container.size() + 1];
|
||||
elements = new Object[container.size() + 1];
|
||||
|
||||
for (T element : container)
|
||||
this.add(element);
|
||||
add(element);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -43,7 +44,7 @@ public class ArrayImpl<T> implements Array<T> {
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return this.size;
|
||||
return size;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@ -127,7 +128,7 @@ public class ArrayImpl<T> implements Array<T> {
|
||||
@Override
|
||||
public T next() {
|
||||
if (!hasNext())
|
||||
throw new java.util.NoSuchElementException();
|
||||
throw new NoSuchElementException();
|
||||
|
||||
lastReturnedIndex = currentIndex;
|
||||
return (T) elements[currentIndex++];
|
||||
|
@ -1,6 +1,7 @@
|
||||
package ua.nure.jfn.task2;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
public class ListImpl<T> implements List<T> {
|
||||
|
||||
@ -114,7 +115,7 @@ public class ListImpl<T> implements List<T> {
|
||||
@Override
|
||||
public void removeFirst() {
|
||||
if (head == null)
|
||||
throw new java.util.NoSuchElementException();
|
||||
throw new NoSuchElementException();
|
||||
|
||||
head = head.next;
|
||||
size--;
|
||||
@ -123,7 +124,7 @@ public class ListImpl<T> implements List<T> {
|
||||
@Override
|
||||
public void removeLast() {
|
||||
if (head == null)
|
||||
throw new java.util.NoSuchElementException();
|
||||
throw new NoSuchElementException();
|
||||
|
||||
if (head.isLast())
|
||||
head = null;
|
||||
@ -137,7 +138,7 @@ public class ListImpl<T> implements List<T> {
|
||||
@Override
|
||||
public T getFirst() {
|
||||
if (head == null)
|
||||
throw new java.util.NoSuchElementException();
|
||||
throw new NoSuchElementException();
|
||||
|
||||
return (T) head.data;
|
||||
}
|
||||
@ -146,12 +147,12 @@ public class ListImpl<T> implements List<T> {
|
||||
@Override
|
||||
public T getLast() {
|
||||
if (head == null)
|
||||
throw new java.util.NoSuchElementException();
|
||||
throw new NoSuchElementException();
|
||||
|
||||
if (head.isLast())
|
||||
return (T) head.data;
|
||||
else
|
||||
return (T) head.getLast();
|
||||
|
||||
return (T) head.getLast();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@ -162,7 +163,8 @@ public class ListImpl<T> implements List<T> {
|
||||
|
||||
if (head.data != null && head.data.equals(element))
|
||||
return (T) head.data;
|
||||
else if (head.next != null)
|
||||
|
||||
if (head.next != null)
|
||||
return (T) head.search(element);
|
||||
|
||||
return null;
|
||||
@ -178,9 +180,8 @@ public class ListImpl<T> implements List<T> {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (head.next != null) {
|
||||
if (head.next != null)
|
||||
return head.remove(element);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -224,7 +225,7 @@ public class ListImpl<T> implements List<T> {
|
||||
@Override
|
||||
public T next() {
|
||||
if (!hasNext())
|
||||
throw new java.util.NoSuchElementException();
|
||||
throw new NoSuchElementException();
|
||||
|
||||
prev = curr;
|
||||
curr = curr.next;
|
||||
|
@ -20,10 +20,9 @@ public class StreamImpl<T> implements Stream<T> {
|
||||
public Container<?> apply(Container<?> input) {
|
||||
Array<T> newContainer = new ArrayImpl<T>();
|
||||
|
||||
for (Object element : input) {
|
||||
for (Object element : input)
|
||||
if (predicate.apply((T) element))
|
||||
newContainer.add((T) element);
|
||||
}
|
||||
|
||||
return newContainer;
|
||||
}
|
||||
@ -41,9 +40,8 @@ public class StreamImpl<T> implements Stream<T> {
|
||||
public Container<?> apply(Container<?> input) {
|
||||
Array<R> newContainer = new ArrayImpl<R>();
|
||||
|
||||
for (Object element : input) {
|
||||
for (Object element : input)
|
||||
newContainer.add(function.apply((T) element));
|
||||
}
|
||||
|
||||
return newContainer;
|
||||
}
|
||||
@ -61,14 +59,14 @@ public class StreamImpl<T> implements Stream<T> {
|
||||
|
||||
@Override
|
||||
public Stream<T> filter(Function<? super T, Boolean> predicate) {
|
||||
Array<Operation> newOperations = new ArrayImpl<>(this.operations);
|
||||
Array<Operation> newOperations = new ArrayImpl<>(operations);
|
||||
newOperations.add(new FilterOperation<>(predicate));
|
||||
return new StreamImpl<T>(source, newOperations);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R> Stream<R> map(Function<? super T, ? extends R> function) {
|
||||
Array<Operation> newOperations = new ArrayImpl<>(this.operations);
|
||||
Array<Operation> newOperations = new ArrayImpl<>(operations);
|
||||
newOperations.add(new MapOperation<>(function));
|
||||
return new StreamImpl<R>(source, newOperations);
|
||||
}
|
||||
@ -88,13 +86,10 @@ public class StreamImpl<T> implements Stream<T> {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void forEach(Action<? super T> action) {
|
||||
for (Operation operation : operations) {
|
||||
for (Operation operation : operations)
|
||||
source = operation.apply(source);
|
||||
}
|
||||
|
||||
for (Object element : source) {
|
||||
for (Object element : source)
|
||||
action.perform((T) element);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
4
semester-4/ОПJа/lb-3/README.md
Normal file
4
semester-4/ОПJа/lb-3/README.md
Normal file
@ -0,0 +1,4 @@
|
||||
> [!NOTE]
|
||||
> Викладач: Колесников Д. О.
|
||||
>
|
||||
> Оцінка: In Progress
|
BIN
semester-4/ОПJа/lb-3/images/converters_output.png
Normal file
BIN
semester-4/ОПJа/lb-3/images/converters_output.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.0 KiB |
BIN
semester-4/ОПJа/lb-3/images/part1_convert3_output.png
Normal file
BIN
semester-4/ОПJа/lb-3/images/part1_convert3_output.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
semester-4/ОПJа/lb-3/task3.zip
Normal file
BIN
semester-4/ОПJа/lb-3/task3.zip
Normal file
Binary file not shown.
202
semester-4/ОПJа/lb-3/task3/.gitignore
vendored
Normal file
202
semester-4/ОПJа/lb-3/task3/.gitignore
vendored
Normal file
@ -0,0 +1,202 @@
|
||||
/target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
|
||||
# Created by https://www.gitignore.io/api/git,java,maven,eclipse,windows
|
||||
|
||||
### Eclipse ###
|
||||
|
||||
.metadata
|
||||
bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
*.bak
|
||||
*.swp
|
||||
*~.nib
|
||||
local.properties
|
||||
.settings/
|
||||
.loadpath
|
||||
.recommenders
|
||||
|
||||
# External tool builders
|
||||
.externalToolBuilders/
|
||||
|
||||
# Locally stored "Eclipse launch configurations"
|
||||
*.launch
|
||||
|
||||
# PyDev specific (Python IDE for Eclipse)
|
||||
*.pydevproject
|
||||
|
||||
# CDT-specific (C/C++ Development Tooling)
|
||||
.cproject
|
||||
|
||||
# CDT- autotools
|
||||
.autotools
|
||||
|
||||
# Java annotation processor (APT)
|
||||
.factorypath
|
||||
|
||||
# PDT-specific (PHP Development Tools)
|
||||
.buildpath
|
||||
|
||||
# sbteclipse plugin
|
||||
.target
|
||||
|
||||
# Tern plugin
|
||||
.tern-project
|
||||
|
||||
# TeXlipse plugin
|
||||
.texlipse
|
||||
|
||||
# STS (Spring Tool Suite)
|
||||
.springBeans
|
||||
|
||||
# Code Recommenders
|
||||
.recommenders/
|
||||
|
||||
# Annotation Processing
|
||||
.apt_generated/
|
||||
|
||||
# Scala IDE specific (Scala & Java development for Eclipse)
|
||||
.cache-main
|
||||
.scala_dependencies
|
||||
.worksheet
|
||||
|
||||
### Eclipse Patch ###
|
||||
# Eclipse Core
|
||||
.project
|
||||
|
||||
# JDT-specific (Eclipse Java Development Tools)
|
||||
.classpath
|
||||
|
||||
# Annotation Processing
|
||||
.apt_generated
|
||||
|
||||
.sts4-cache/
|
||||
|
||||
### Git ###
|
||||
# Created by git for backups. To disable backups in Git:
|
||||
# $ git config --global mergetool.keepBackup false
|
||||
*.orig
|
||||
|
||||
# Created by git when using merge tools for conflicts
|
||||
*.BACKUP.*
|
||||
*.BASE.*
|
||||
*.LOCAL.*
|
||||
*.REMOTE.*
|
||||
*_BACKUP_*.txt
|
||||
*_BASE_*.txt
|
||||
*_LOCAL_*.txt
|
||||
*_REMOTE_*.txt
|
||||
|
||||
### Java ###
|
||||
# Compiled class file
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
*.log
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
||||
### Maven ###
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
### Windows ###
|
||||
# Windows thumbnail cache files
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
|
||||
# Dump file
|
||||
*.stackdump
|
||||
|
||||
# Folder config file
|
||||
[Dd]esktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Some additional ignores (sort later)
|
||||
*.DS_Store
|
||||
*.sw?
|
||||
.#*
|
||||
*#
|
||||
*~
|
||||
.classpath
|
||||
.project
|
||||
.settings
|
||||
bin
|
||||
build
|
||||
target
|
||||
dependency-reduced-pom.xml
|
||||
*.sublime-*
|
||||
/scratch
|
||||
.gradle
|
||||
README.html
|
||||
*.iml
|
||||
.idea
|
||||
.exercism
|
||||
|
6
semester-4/ОПJа/lb-3/task3/part1.txt
Normal file
6
semester-4/ОПJа/lb-3/task3/part1.txt
Normal file
@ -0,0 +1,6 @@
|
||||
Login;Name;Email
|
||||
petrenko;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com
|
||||
ivanenko;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD>i <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;ivanenko@mail.com
|
||||
obama;Barack Hussein Obama;obama@gmail.com
|
||||
lennon;John Lennon;lennon@live.com
|
||||
bush;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>;bush@gmail.com
|
2
semester-4/ОПJа/lb-3/task3/part2.txt
Normal file
2
semester-4/ОПJа/lb-3/task3/part2.txt
Normal file
@ -0,0 +1,2 @@
|
||||
When I was younger, so much younger than today
|
||||
I never needed anybody's help in any way
|
2
semester-4/ОПJа/lb-3/task3/part3.txt
Normal file
2
semester-4/ОПJа/lb-3/task3/part3.txt
Normal file
@ -0,0 +1,2 @@
|
||||
when I was younger younger than today was
|
||||
I never needed needed never never was I was
|
58
semester-4/ОПJа/lb-3/task3/pom.xml
Normal file
58
semester-4/ОПJа/lb-3/task3/pom.xml
Normal file
@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>ua.nure.jfn</groupId>
|
||||
<artifactId>task3</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.release>17</maven.compiler.release>
|
||||
<junit5.version>5.12.0</junit5.version>
|
||||
<surefire.version>3.5.2</surefire.version>
|
||||
<spoon.version>11.2.0</spoon.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
<version>${junit5.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-params</artifactId>
|
||||
<version>${junit5.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.inria.gforge.spoon</groupId>
|
||||
<artifactId>spoon-core</artifactId>
|
||||
<version>${spoon.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
<version>2.0.17</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>task3</finalName>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${surefire.version}</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
</project>
|
@ -0,0 +1,46 @@
|
||||
package ua.nure.jfn.task3;
|
||||
|
||||
import ua.nure.jfn.task3.converter.CyrillicConverter;
|
||||
import ua.nure.jfn.task3.converter.MayaConverter;
|
||||
import ua.nure.jfn.task3.converter.PositionalConverter;
|
||||
import ua.nure.jfn.task3.converter.RomanConverter;
|
||||
|
||||
public class Demo {
|
||||
|
||||
private static final String[] EMPTY = new String[] {};
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println("----Part 1----");
|
||||
Part1.main(EMPTY);
|
||||
|
||||
System.out.println("----Part 2----");
|
||||
Part2.main(EMPTY);
|
||||
|
||||
System.out.println("----Part 3----");
|
||||
Part3.main(EMPTY);
|
||||
|
||||
String s;
|
||||
|
||||
System.out.println("----Cyrillic----");
|
||||
s = "999_999";
|
||||
System.out.println(s);
|
||||
System.out.println(CyrillicConverter.convert(s));
|
||||
|
||||
System.out.println();
|
||||
System.out.println("----Maya----");
|
||||
s = "100_000";
|
||||
System.out.println(s);
|
||||
System.out.println(MayaConverter.convert(s));
|
||||
|
||||
System.out.println();
|
||||
System.out.println("----Roman----");
|
||||
s = "3_999";
|
||||
System.out.println(s);
|
||||
System.out.println(RomanConverter.convert(s));
|
||||
|
||||
System.out.println();
|
||||
System.out.println("----Positional----");
|
||||
PositionalConverter.main(EMPTY);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package ua.nure.jfn.task3;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class Part1 {
|
||||
|
||||
private static final String PATH = "part1.txt";
|
||||
|
||||
public static void main(String[] args) {
|
||||
String lines = Utils.getContent(PATH);
|
||||
System.out.println(convert1(lines));
|
||||
System.out.println();
|
||||
System.out.println(convert2(lines));
|
||||
System.out.println();
|
||||
System.out.println(convert3(lines));
|
||||
}
|
||||
|
||||
public static String convert1(String input) {
|
||||
Matcher matcher = Pattern.compile(" ([\\S]*;[\\S]*@[\\S]*)").matcher(input);
|
||||
|
||||
String result = "LastName;Email";
|
||||
while (matcher.find())
|
||||
result += "\n" + matcher.group(1);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static String convert2(String input) {
|
||||
Matcher matcher = Pattern.compile(";([\\S]*) *([\\S]*) ([\\S]*);").matcher(input);
|
||||
|
||||
String result = "LastName;MiddleName;FirstName";
|
||||
while (matcher.find())
|
||||
result += String.format(
|
||||
"\n%s;%s;%s",
|
||||
matcher.group(3),
|
||||
matcher.group(2),
|
||||
matcher.group(1));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static String convert3(String input) {
|
||||
Matcher matcher = Pattern.compile("(.*);(.*) ([^\\s]*);").matcher(input);
|
||||
|
||||
int[] len = { 0, 0, 0 };
|
||||
while (matcher.find())
|
||||
for (int i = 0; i < 3; i++)
|
||||
len[i] = Utils.max(len[i], matcher.group(i + 1).length());
|
||||
|
||||
matcher.reset();
|
||||
|
||||
String result = "";
|
||||
while (matcher.find())
|
||||
result += String.format(
|
||||
"\n%-" + len[2] + "s %-" + len[1] + "s %-" + len[0] + "s",
|
||||
matcher.group(3),
|
||||
matcher.group(2),
|
||||
matcher.group(1));
|
||||
|
||||
return result.trim();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package ua.nure.jfn.task3;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class Part2 {
|
||||
|
||||
private static final String PATH = "part2.txt";
|
||||
|
||||
public static void main(String[] args) {
|
||||
String lines = Utils.getContent(PATH);
|
||||
for (int j = 1; j < 10; j++)
|
||||
System.out.println(convert(lines, j));
|
||||
}
|
||||
|
||||
public static String convert(String input, int k) {
|
||||
int lengths = 0;
|
||||
|
||||
for (String word : input.split(" "))
|
||||
lengths |= 1 << (word.length() - 1);
|
||||
|
||||
int kLength = 0;
|
||||
int currLength = 0;
|
||||
|
||||
for (; lengths > 0 && currLength != k; lengths >>= 1) {
|
||||
kLength++;
|
||||
|
||||
if ((lengths & 1) == 1)
|
||||
currLength++;
|
||||
}
|
||||
|
||||
if (currLength != k)
|
||||
kLength = 0;
|
||||
|
||||
Matcher matcher = Pattern.compile(String.format("(?<=^|\\s)(\\S{%d})(?=$|\\s)", kLength)).matcher(input);
|
||||
|
||||
String result = "";
|
||||
while (matcher.find())
|
||||
if (!result.matches(".*(?<=^|\\s)" + matcher.group(1) + "(?=$|\\s).*"))
|
||||
result += " " + matcher.group(1);
|
||||
|
||||
if (result != "")
|
||||
result = k + ":" + result;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package ua.nure.jfn.task3;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class Part3 {
|
||||
|
||||
private static final String PATH = "part3.txt";
|
||||
|
||||
public static void main(String[] args) {
|
||||
String lines = Utils.getContent(PATH);
|
||||
System.out.println(convert(lines));
|
||||
}
|
||||
|
||||
public static String convert(String input) {
|
||||
String[] words = input.split("\\s+");
|
||||
String result = input;
|
||||
|
||||
int last = 0;
|
||||
String[] processed = new String[words.length];
|
||||
for (String word : words) {
|
||||
if (Utils.contains(word, processed))
|
||||
continue;
|
||||
|
||||
Pattern pattern = Pattern.compile("(?<=^|\\s)(\\Q" + word + "\\E)(?=$|\\s)",
|
||||
Pattern.UNICODE_CHARACTER_CLASS);
|
||||
|
||||
Matcher matcher = pattern.matcher(input);
|
||||
for (int i = 0; matcher.find(); i++) {
|
||||
if (i % 2 != 0)
|
||||
result = Utils.copyOfRange(result, 0, matcher.start()) + Utils.changeCase(matcher.group())
|
||||
+ Utils.copyOfRange(result, matcher.end(), input.length());
|
||||
}
|
||||
|
||||
processed[last++] = word;
|
||||
}
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package ua.nure.jfn.task3;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
public final class Utils {
|
||||
|
||||
private static final String ENCODING = "Cp1251";
|
||||
|
||||
private Utils() {
|
||||
|
||||
}
|
||||
|
||||
public static int parseInt(String s, int base) {
|
||||
int num = 0;
|
||||
int pow = 1;
|
||||
|
||||
char[] chArray = s.toCharArray();
|
||||
for (int i = chArray.length - 1; i >= 0; i--) {
|
||||
char ch = chArray[i];
|
||||
if (ch >= '0' && ch <= '9') {
|
||||
num += (ch - '0') * pow;
|
||||
pow *= base;
|
||||
} else if (ch >= 'A' && ch <= 'Z') {
|
||||
num += (ch - 'A' + 10) * pow;
|
||||
pow *= base;
|
||||
}
|
||||
}
|
||||
|
||||
return num;
|
||||
}
|
||||
|
||||
public static int parseInt(String s) {
|
||||
return parseInt(s, 10);
|
||||
}
|
||||
|
||||
public static String changeCase(String s) {
|
||||
String arr1 = "abcdefghijklmnopqrstuvwxyzабвгґдеєжзиіїйклмнопрстуфхцчшщьюяABCDEFGHIJKLMNOPQRSTUVWXYZАБВГҐДЕЄЖЗИІЇЙКЛМНОПРСТУФХЦЧШЩЬЮЯ";
|
||||
String arr2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZАБВГҐДЕЄЖЗИІЇЙКЛМНОПРСТУФХЦЧШЩЬЮЯabcdefghijklmnopqrstuvwxyzабвгґдеєжзиіїйклмнопрстуфхцчшщьюя";
|
||||
|
||||
String result = "";
|
||||
|
||||
for (char c : s.toCharArray()) {
|
||||
int i = arr1.indexOf(c);
|
||||
if (i != -1)
|
||||
c = arr2.charAt(i);
|
||||
|
||||
result += c;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static boolean contains(String o, String[] arr) {
|
||||
for (String e : arr)
|
||||
if (e != null && e.equals(o))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String copyOfRange(String s, int start, int end) {
|
||||
char[] arr = s.toCharArray();
|
||||
|
||||
char[] result = new char[end - start];
|
||||
for (int i = 0; i < end - start; i++)
|
||||
result[i] = arr[start + i];
|
||||
|
||||
return new String(result);
|
||||
}
|
||||
|
||||
public static int max(int a, int b) {
|
||||
return a > b ? a : b;
|
||||
}
|
||||
|
||||
public static String getContent(String path) {
|
||||
String res = null;
|
||||
try {
|
||||
byte[] bytes = Files.readAllBytes(Paths.get(path));
|
||||
res = new String(bytes, ENCODING);
|
||||
} catch (IOException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(getContent("part1.txt"));
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package ua.nure.jfn.task3.converter;
|
||||
|
||||
import ua.nure.jfn.task3.Utils;
|
||||
|
||||
// Cyrillic numerals.
|
||||
public class CyrillicConverter {
|
||||
|
||||
private static char[][] digits = {
|
||||
{ '\u0430', '\u0432', '\u0433', '\u0434', '\u0454', '\u0455', '\u0437', '\u0438', '\u0473' },
|
||||
{ '\u0456', '\u043A', '\u043B', '\u043C', '\u043D', '\u046F', '\u043E', '\u043F', '\u0447' },
|
||||
{ '\u0440', '\u0441', '\u0442', '\u0443', '\u0444', '\u0445', '\u0471', '\u0461', '\u0446' }
|
||||
};
|
||||
|
||||
/**
|
||||
* The thousands sign to multiply the number's value.
|
||||
*/
|
||||
private static char kMul = '\u0482';
|
||||
|
||||
public static String convert(String str) {
|
||||
int num = Utils.parseInt(str);
|
||||
String result = "";
|
||||
|
||||
boolean isK = false;
|
||||
int digitPlace = 0;
|
||||
|
||||
while (num != 0) {
|
||||
int digit = (num % 10);
|
||||
|
||||
if (digit > 0)
|
||||
result = String.format("%s%s%s", isK ? kMul : "", digits[digitPlace][digit - 1], result);
|
||||
|
||||
num /= 10;
|
||||
isK = digitPlace == 2 ? true : isK;
|
||||
digitPlace += digitPlace == 2 ? -2 : 1;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println("All the digits:");
|
||||
int k = 1;
|
||||
for (int j = 0; j < 3; j++) {
|
||||
for (int i = 0; i < 9; i++) {
|
||||
System.out.printf("%3s: %s [%s, %s]%n", (i + 1) * k, digits[j][i], j, i);
|
||||
}
|
||||
k *= 10;
|
||||
}
|
||||
System.out.println(kMul);
|
||||
String s = "999_999";
|
||||
System.out.printf("Maximum value (%s):%n", s);
|
||||
System.out.println(CyrillicConverter.convert(s));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package ua.nure.jfn.task3.converter;
|
||||
|
||||
import ua.nure.jfn.task3.Utils;
|
||||
|
||||
// Maya numerals.
|
||||
// You can use Google Font: "Noto Sans Mayan Numerals" to see the Mayan digits.
|
||||
public class MayaConverter {
|
||||
|
||||
private static final String[] ar = new String[20];
|
||||
|
||||
static {
|
||||
int mayaZeroHighSurrogate = 0xDEE0;
|
||||
for (int j = 0; j < 20; j++) {
|
||||
ar[j] = "\uD834" + (char) (mayaZeroHighSurrogate + j);
|
||||
}
|
||||
}
|
||||
|
||||
public static String convert(String from) {
|
||||
int num = Utils.parseInt(from);
|
||||
String result = "";
|
||||
|
||||
if (num == 0)
|
||||
result = ar[0];
|
||||
|
||||
for (; num > 0; num /= 20)
|
||||
result = ar[num % 20] + result;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println("All the digits:");
|
||||
for (int j = 0; j < ar.length; j++) {
|
||||
System.out.printf("%2s: %s%n", j, ar[j]);
|
||||
}
|
||||
System.out.println("~~~");
|
||||
System.out.println(429);
|
||||
System.out.println(MayaConverter.convert("429"));
|
||||
System.out.println("~~~");
|
||||
System.out.println("100_000");
|
||||
System.out.println(MayaConverter.convert(String.valueOf("100_000")));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package ua.nure.jfn.task3.converter;
|
||||
|
||||
import ua.nure.jfn.task3.Utils;
|
||||
|
||||
public class PositionalConverter {
|
||||
|
||||
public static String convert(String s) {
|
||||
String[] parts = s.split(":");
|
||||
|
||||
int from = Utils.parseInt(parts[0]);
|
||||
int num = Utils.parseInt(parts[1], from);
|
||||
int to = Utils.parseInt(parts[2]);
|
||||
|
||||
if (num == 0)
|
||||
return "0";
|
||||
|
||||
String result = "";
|
||||
for (; num > 0; num /= to) {
|
||||
char c = (char) (num % to);
|
||||
|
||||
if (c <= 9) {
|
||||
c += '0';
|
||||
} else {
|
||||
c += 'A' - 10;
|
||||
}
|
||||
|
||||
result = c + result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String s;
|
||||
|
||||
s = "10:15:16";
|
||||
System.out.printf("%s ==> %s%n", s, PositionalConverter.convert(s));
|
||||
s = "36:XYZ:2";
|
||||
System.out.printf("%s ==> %s%n", s, PositionalConverter.convert(s));
|
||||
s = "10:171:36";
|
||||
System.out.printf("%s ==> %s%n", s, PositionalConverter.convert(s));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package ua.nure.jfn.task3.converter;
|
||||
|
||||
import ua.nure.jfn.task3.Utils;
|
||||
|
||||
// Roman numerals.
|
||||
public class RomanConverter {
|
||||
|
||||
private static final String[] digits = {
|
||||
"\u216F", // M
|
||||
"\u216D\u216F", // CM
|
||||
"\u216E", // D
|
||||
"\u216D\u216E", // CD
|
||||
"\u216D", // C
|
||||
"\u2169\u216D", // XC
|
||||
"\u216C", // L
|
||||
"\u2169\u216C", // XL
|
||||
"\u2169", // X
|
||||
"\u2160\u2169", // IX
|
||||
"\u2164", // V
|
||||
"\u2160\u2164", // IV
|
||||
"\u2160" // I
|
||||
};
|
||||
|
||||
private static final int[] values = {
|
||||
1000, // M
|
||||
900, // CM
|
||||
500, // D
|
||||
400, // CD
|
||||
100, // C
|
||||
90, // XC
|
||||
50, // L
|
||||
40, // XL
|
||||
10, // X
|
||||
9, // IX
|
||||
5, // V
|
||||
4, // IV
|
||||
1 // I
|
||||
};
|
||||
|
||||
public static String convert(String str) {
|
||||
int num = Utils.parseInt(str);
|
||||
String result = "";
|
||||
|
||||
for (int i = 0; i < values.length; i++) {
|
||||
while (num >= values[i]) {
|
||||
num -= values[i];
|
||||
result += digits[i];
|
||||
}
|
||||
}
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println("All the digits");
|
||||
for (int j = 0; j < digits.length; j++) {
|
||||
System.out.printf("%s: %s%n", digits[j], values[j]);
|
||||
}
|
||||
String s;
|
||||
System.out.println("~~~");
|
||||
s = "444";
|
||||
System.out.println(s);
|
||||
System.out.println(RomanConverter.convert(s));
|
||||
System.out.println("~~~");
|
||||
s = "3_999";
|
||||
System.out.println(s);
|
||||
System.out.println(RomanConverter.convert(s));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package ua.nure.jfn.task3;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
|
||||
/**
|
||||
* @author Dmytro Kolesnykov
|
||||
*/
|
||||
public class Base {
|
||||
|
||||
{
|
||||
if (ComplianceTest.MAKE_ALL_TESTS_FAILED) {
|
||||
Assertions.fail("Compliance tests have not been passed", ComplianceTest.CAUSE);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,122 @@
|
||||
package ua.nure.jfn.task3;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import spoon.Launcher;
|
||||
import spoon.SpoonAPI;
|
||||
import spoon.reflect.declaration.CtType;
|
||||
import spoon.reflect.reference.CtTypeReference;
|
||||
import spoon.reflect.visitor.filter.TypeFilter;
|
||||
|
||||
/**
|
||||
* @author Dmytro Kolesnykov
|
||||
*/
|
||||
@Disabled("This test is used as a trigger to fail all the other tests")
|
||||
class ComplianceTest {
|
||||
|
||||
// Assign this option to false to skip the compliance test
|
||||
// Note, during testing at the stand this option will be turned on!!!
|
||||
// private static final boolean TURN_TEST_COMPLIANCE_ON = false;
|
||||
private static final boolean TURN_TEST_COMPLIANCE_ON = true;
|
||||
|
||||
public static final boolean MAKE_ALL_TESTS_FAILED;
|
||||
|
||||
public static final Throwable CAUSE;
|
||||
|
||||
private static final Object EOL = System.lineSeparator();
|
||||
|
||||
static {
|
||||
L: {
|
||||
try {
|
||||
if (TURN_TEST_COMPLIANCE_ON) {
|
||||
initSpoon();
|
||||
startCompianceTests();
|
||||
}
|
||||
} catch (ReflectiveOperationException ex) {
|
||||
MAKE_ALL_TESTS_FAILED = true;
|
||||
CAUSE = ex.getCause();
|
||||
break L;
|
||||
}
|
||||
MAKE_ALL_TESTS_FAILED = false;
|
||||
CAUSE = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static SpoonAPI spoon;
|
||||
|
||||
private static void initSpoon() {
|
||||
spoon = new Launcher();
|
||||
spoon.addInputResource("src/main/java/");
|
||||
spoon.buildModel();
|
||||
}
|
||||
|
||||
private static void startCompianceTests() throws ReflectiveOperationException {
|
||||
ComplianceTest cTest = new ComplianceTest();
|
||||
for (Method m : ComplianceTest.class.getDeclaredMethods()) {
|
||||
if (Modifier.isPrivate(m.getModifiers())) {
|
||||
continue;
|
||||
}
|
||||
Test[] ar = m.getAnnotationsByType(Test.class);
|
||||
if (ar.length > 0 && m.getAnnotationsByType(Test.class)[0] != null) {
|
||||
m.invoke(cTest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////
|
||||
|
||||
@Test
|
||||
void appShouldNotUseForbiddenAPI() throws IOException, URISyntaxException {
|
||||
URL url = getClass().getResource("forbidden-api-regex.txt");
|
||||
String regex = Files.readString(Path.of(url.toURI()));
|
||||
Pattern forbiddenAPIRegex = Pattern.compile(regex.toString());
|
||||
StringBuilder errorMessage = new StringBuilder();
|
||||
for (CtType<?> ctType : spoon.getModel().getAllTypes()) {
|
||||
List<String> forbiddenAPI = ctType.getElements(new TypeFilter<>(CtTypeReference.class))
|
||||
.stream()
|
||||
.distinct()
|
||||
.filter(r -> forbiddenAPIRegex.matcher(r.toString()).matches())
|
||||
.map(CtTypeReference::getQualifiedName)
|
||||
.toList();
|
||||
if (!forbiddenAPI.isEmpty()) {
|
||||
errorMessage.append(EOL)
|
||||
.append(ctType.getQualifiedName()).append(": ")
|
||||
.append(forbiddenAPI);
|
||||
}
|
||||
}
|
||||
if (!errorMessage.isEmpty()) {
|
||||
fail(() -> "Using of this API is forbidden: " + errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldBeAppropriateNumberOfPackagesAndClasses() throws IOException, URISyntaxException {
|
||||
URL url = getClass().getResource("list-of-types.txt");
|
||||
String expected = Files.readString(Path.of(url.toURI()));
|
||||
// '\n' character is used for clarity in error message
|
||||
String actual = spoon.getModel().getAllPackages().stream()
|
||||
.filter(p -> p.getTypes().size() != 0)
|
||||
.map(p -> p.getTypes().stream()
|
||||
.map(CtType::getQualifiedName)
|
||||
.sorted()
|
||||
.collect(Collectors.joining("\n")))
|
||||
.collect(Collectors.joining("\n"));
|
||||
assertEquals('\n' + expected.trim(), '\n' + actual.trim());
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package ua.nure.jfn.task3;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.CsvFileSource;
|
||||
|
||||
/**
|
||||
* @author Dmytro Kolesnykov
|
||||
*/
|
||||
class Part1Test extends Base {
|
||||
|
||||
@ParameterizedTest
|
||||
@CsvFileSource(delimiter = '|', encoding = "Cp1251", resources = "part1-convert1.csv")
|
||||
void testConvert1(String inputString, String expectedString) {
|
||||
String expected = expectedString.replace("~", "\n");
|
||||
String input = inputString.replace("~", "\n");
|
||||
String actual = Part1.convert1(input).replaceAll("\r", "");
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@CsvFileSource(delimiter = '|', encoding = "Cp1251", resources = "part1-convert2.csv")
|
||||
void testConvert2(String inputString, String expectedString) {
|
||||
String expected = expectedString.replace("~", "\n");
|
||||
String input = inputString.replace("~", "\n");
|
||||
String actual = Part1.convert2(input).replaceAll("\r", "");
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@CsvFileSource(delimiter = '|', encoding = "Cp1251", resources = "part1-convert3.csv")
|
||||
void testConvert3(String inputString, String expectedString) {
|
||||
String expected = expectedString.replace("~", "\n");
|
||||
String input = inputString.replace("~", "\n");
|
||||
String actual = Part1.convert3(input).replaceAll("\r", "");
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package ua.nure.jfn.task3;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.CsvFileSource;
|
||||
|
||||
/**
|
||||
* @author Dmytro Kolesnykov
|
||||
*/
|
||||
class Part2Test extends Base {
|
||||
|
||||
@ParameterizedTest
|
||||
@CsvFileSource(delimiter = '|', encoding = "Cp1251", resources = "part2.csv")
|
||||
void testConvert(String inputString, String kString, String expectedString) {
|
||||
String expected = expectedString != null ? expectedString.replace("~", "\n") : "";
|
||||
int k = Integer.parseInt(kString);
|
||||
String input = inputString.replace("~", "\n");
|
||||
String actual = Part2.convert(input, k).replaceAll("\r", "");
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package ua.nure.jfn.task3;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.CsvFileSource;
|
||||
|
||||
/**
|
||||
* @author Dmytro Kolesnykov
|
||||
*/
|
||||
class Part3Test extends Base {
|
||||
|
||||
@ParameterizedTest
|
||||
@CsvFileSource(delimiter = '|', encoding = "Cp1251", resources = "part3.csv")
|
||||
void testConvert(String inputString, String expectedString) {
|
||||
String expected = expectedString.replace("~", "\n");
|
||||
String input = inputString.replace("~", "\n");
|
||||
String actual = Part3.convert(input).replaceAll("\r", "");
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package ua.nure.jfn.task3.converter;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.CsvFileSource;
|
||||
|
||||
import ua.nure.jfn.task3.Base;
|
||||
|
||||
/**
|
||||
* @author Dmytro Kolesnykov
|
||||
*/
|
||||
public class ConverterTest extends Base {
|
||||
|
||||
@ParameterizedTest
|
||||
@CsvFileSource(delimiter = '|', encoding = "UTF-8", resources = "cyrillic.csv")
|
||||
void testCyrillicConvert(String input, String expected) {
|
||||
String actual = CyrillicConverter.convert(input);
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@CsvFileSource(delimiter = '|', encoding = "UTF-8", resources = "positional.csv")
|
||||
void testPositionalConvert(String input, String expected) {
|
||||
String actual = PositionalConverter.convert(input);
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@CsvFileSource(delimiter = '|', encoding = "UTF-8", resources = "maya.csv")
|
||||
void testMayanConvert(String input, String expected) {
|
||||
String actual = MayaConverter.convert(input);
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@CsvFileSource(delimiter = '|', encoding = "UTF-8", resources = "roman.csv")
|
||||
void testRomanConvert(String input, String expected) {
|
||||
String actual = RomanConverter.convert(input);
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
# To see Cyrillic digits you can use 'Consolas' font
|
||||
|
||||
1 | а
|
||||
10 | і
|
||||
19 | іѳ
|
||||
20 | к
|
||||
901 | ца
|
||||
410 | уі
|
||||
80_030 | ҂пл
|
||||
999_999 | ҂ц҂ч҂ѳцчѳ
|
||||
987_321 | ҂ц҂п҂зтка
|
||||
100_290 | ҂рсч
|
|
@ -0,0 +1,12 @@
|
||||
# To see Mayan digits you can use 'BabelStone Mayan Numerals' font
|
||||
|
||||
429 | 𝋡𝋡𝋩
|
||||
100_000 | 𝋬𝋪𝋠𝋠
|
||||
2147483647 | 𝋡𝋭𝋫𝋡𝋯𝋩𝋢𝋧
|
||||
1 | 𝋡
|
||||
202020 | 𝋡𝋥𝋥𝋡𝋠
|
||||
19 | 𝋳
|
||||
20 | 𝋡𝋠
|
||||
3_999 | 𝋩𝋳𝋳
|
||||
399 | 𝋳𝋳
|
||||
400 | 𝋡𝋠𝋠
|
|
@ -0,0 +1,10 @@
|
||||
10:429:36 | BX
|
||||
15:10_000:4 | 30113001
|
||||
10:2147483647:16 | 7FFFFFFF
|
||||
10:1:36 | 1
|
||||
3:202020:10 | 546
|
||||
36:XYZ:2 | 1010101111111011
|
||||
36:1:2 | 1
|
||||
2:1:36 | 1
|
||||
10:36:36 | 10
|
||||
10:8:8 | 10
|
|
@ -0,0 +1,12 @@
|
||||
# To see Roman digits you can use 'Microsoft Sans Serif' font
|
||||
|
||||
3_999 | ⅯⅯⅯⅭⅯⅩⅭⅠⅩ
|
||||
444 | ⅭⅮⅩⅬⅠⅤ
|
||||
949 | ⅭⅯⅩⅬⅠⅩ
|
||||
1 | Ⅰ
|
||||
2949 | ⅯⅯⅭⅯⅩⅬⅠⅩ
|
||||
4 | ⅠⅤ
|
||||
3_201 | ⅯⅯⅯⅭⅭⅠ
|
||||
1003 | ⅯⅠⅠⅠ
|
||||
770 | ⅮⅭⅭⅬⅩⅩ
|
||||
9 | ⅠⅩ
|
|
@ -0,0 +1,8 @@
|
||||
(?x)
|
||||
^
|
||||
(?:java\.util\.[^.]+)
|
||||
|
|
||||
(?:java\.util\.stream\.[^.]+)
|
||||
|
|
||||
(?:java\.lang\.(?:Byte|Short|Integer|Long|Float|Double|Character))
|
||||
$
|
@ -0,0 +1,9 @@
|
||||
ua.nure.jfn.task3.Demo
|
||||
ua.nure.jfn.task3.Part1
|
||||
ua.nure.jfn.task3.Part2
|
||||
ua.nure.jfn.task3.Part3
|
||||
ua.nure.jfn.task3.Utils
|
||||
ua.nure.jfn.task3.converter.CyrillicConverter
|
||||
ua.nure.jfn.task3.converter.MayaConverter
|
||||
ua.nure.jfn.task3.converter.PositionalConverter
|
||||
ua.nure.jfn.task3.converter.RomanConverter
|
@ -0,0 +1,56 @@
|
||||
|
||||
Login;Name;Email
|
||||
petrenko;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com
|
||||
ivanenko;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD>i <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;ivanenko@mail.com
|
||||
obama;Barack Hussein Obama;obama@gmail.com
|
||||
lennon;John Lennon;lennon@live.com
|
||||
bush;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>;bush@gmail.com
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LastName;Email
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;ivanenko@mail.com
|
||||
Obama;obama@gmail.com
|
||||
Lennon;lennon@live.com
|
||||
<EFBFBD><EFBFBD><EFBFBD>;bush@gmail.com
|
||||
|
||||
====================================
|
||||
|
||||
Login;Name;Email
|
||||
petrenko;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LastName;Email
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com
|
||||
|
||||
====================================
|
||||
|
||||
Login;Name;Email
|
||||
petrenko;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com
|
||||
ivanenko;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;ivanenko@mail.com
|
||||
obama;Barack Hussein Obama;obama@gmail.com
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LastName;Email
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;ivanenko@mail.com
|
||||
Obama;obama@gmail.com
|
||||
|
||||
====================================
|
||||
|
||||
Login;Name;Email
|
||||
obama;Barack Hussein Obama;obama@gmail.com
|
||||
obama;Barack Hussein Obama;obama@gmail.com
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LastName;Email
|
||||
Obama;obama@gmail.com
|
||||
Obama;obama@gmail.com
|
||||
|
||||
====================================
|
||||
|
||||
Login;Name;Email
|
||||
a;b c d;e@f.g
|
||||
h;i j k;l@n.n
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LastName;Email
|
||||
d;e@f.g
|
||||
k;l@n.n
|
||||
|
||||
====================================
|
@ -0,0 +1,5 @@
|
||||
Login;Name;Email~petrenko;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com~ivanenko;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD>i <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;ivanenko@mail.com~obama;Barack Hussein Obama;obama@gmail.com~lennon;John Lennon;lennon@live.com~bush;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>;bush@gmail.com|LastName;Email~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;ivanenko@mail.com~Obama;obama@gmail.com~Lennon;lennon@live.com~<7E><><EFBFBD>;bush@gmail.com
|
||||
Login;Name;Email~petrenko;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com|LastName;Email~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com
|
||||
Login;Name;Email~petrenko;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com~ivanenko;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;ivanenko@mail.com~obama;Barack Hussein Obama;obama@gmail.com|LastName;Email~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;ivanenko@mail.com~Obama;obama@gmail.com
|
||||
Login;Name;Email~obama;Barack Hussein Obama;obama@gmail.com~obama;Barack Hussein Obama;obama@gmail.com|LastName;Email~Obama;obama@gmail.com~Obama;obama@gmail.com
|
||||
Login;Name;Email~a;b c d;e@f.g~h;i j k;l@n.n|LastName;Email~d;e@f.g~k;l@n.n
|
|
@ -0,0 +1,56 @@
|
||||
|
||||
Login;Name;Email
|
||||
petrenko;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com
|
||||
ivanenko;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD>i <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;ivanenko@mail.com
|
||||
obama;Barack Hussein Obama;obama@gmail.com
|
||||
lennon;John Lennon;lennon@live.com
|
||||
bush;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>;bush@gmail.com
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LastName;MiddleName;FirstName
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;;<3B><><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD>i
|
||||
Obama;Hussein;Barack
|
||||
Lennon;;John
|
||||
<EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
====================================
|
||||
|
||||
Login;Name;Email
|
||||
petrenko;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LastName;MiddleName;FirstName
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;;<3B><><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
====================================
|
||||
|
||||
Login;Name;Email
|
||||
petrenko;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com
|
||||
ivanenko;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;ivanenko@mail.com
|
||||
obama;Barack Hussein Obama;obama@gmail.com
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LastName;MiddleName;FirstName
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;;<3B><><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
Obama;Hussein;Barack
|
||||
|
||||
====================================
|
||||
|
||||
Login;Name;Email
|
||||
obama;Barack Hussein Obama;obama@gmail.com
|
||||
obama;Barack Hussein Obama;obama@gmail.com
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LastName;MiddleName;FirstName
|
||||
Obama;Hussein;Barack
|
||||
Obama;Hussein;Barack
|
||||
|
||||
====================================
|
||||
|
||||
Login;Name;Email
|
||||
a;b c d;e@f.g
|
||||
h;i j k;l@n.n
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LastName;MiddleName;FirstName
|
||||
d;c;b
|
||||
k;j;i
|
||||
|
||||
====================================
|
@ -0,0 +1,5 @@
|
||||
Login;Name;Email~petrenko;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com~ivanenko;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD>i <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;ivanenko@mail.com~obama;Barack Hussein Obama;obama@gmail.com~lennon;John Lennon;lennon@live.com~bush;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>;bush@gmail.com|LastName;MiddleName;FirstName~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;;<3B><><EFBFBD><EFBFBD><EFBFBD>~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD>i~Obama;Hussein;Barack~Lennon;;John~<7E><><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
Login;Name;Email~petrenko;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com|LastName;MiddleName;FirstName~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;;<3B><><EFBFBD><EFBFBD><EFBFBD>
|
||||
Login;Name;Email~petrenko;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com~ivanenko;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;ivanenko@mail.com~obama;Barack Hussein Obama;obama@gmail.com|LastName;MiddleName;FirstName~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;;<3B><><EFBFBD><EFBFBD><EFBFBD>~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>~Obama;Hussein;Barack
|
||||
Login;Name;Email~obama;Barack Hussein Obama;obama@gmail.com~obama;Barack Hussein Obama;obama@gmail.com|LastName;MiddleName;FirstName~Obama;Hussein;Barack~Obama;Hussein;Barack
|
||||
Login;Name;Email~a;b c d;e@f.g~h;i j k;l@n.n|LastName;MiddleName;FirstName~d;c;b~k;j;i
|
|
@ -0,0 +1,51 @@
|
||||
|
||||
Login;Name;Email
|
||||
petrenko;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com
|
||||
ivanenko;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD>i <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;ivanenko@mail.com
|
||||
obama;Barack Hussein Obama;obama@gmail.com
|
||||
lennon;John Lennon;lennon@live.com
|
||||
bush;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>;bush@gmail.com
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> petrenko
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD>i ivanenko
|
||||
Obama Barack Hussein obama
|
||||
Lennon John lennon
|
||||
<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> bush
|
||||
|
||||
====================================
|
||||
|
||||
Login;Name;Email
|
||||
petrenko;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> petrenko
|
||||
|
||||
====================================
|
||||
|
||||
Login;Name;Email
|
||||
petrenko;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com
|
||||
ivanenko;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;ivanenko@mail.com
|
||||
obama;Barack Hussein Obama;obama@gmail.com
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> petrenko
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ivanenko
|
||||
Obama Barack Hussein obama
|
||||
|
||||
====================================
|
||||
|
||||
Login;Name;Email
|
||||
obama;Barack Hussein Obama;obama@gmail.com
|
||||
obama;Barack Hussein Obama;obama@gmail.com
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Obama Barack Hussein obama
|
||||
Obama Barack Hussein obama
|
||||
|
||||
====================================
|
||||
|
||||
Login;Name;Email
|
||||
a;b c d;e@f.g
|
||||
h;i j k;l@n.n
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
d b c a
|
||||
k i j h
|
||||
|
||||
====================================
|
@ -0,0 +1,5 @@
|
||||
Login;Name;Email~petrenko;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com~ivanenko;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD>i <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;ivanenko@mail.com~obama;Barack Hussein Obama;obama@gmail.com~lennon;John Lennon;lennon@live.com~bush;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>;bush@gmail.com|<7C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> petrenko~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD>i ivanenko~Obama Barack Hussein obama ~Lennon John lennon ~<7E><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> bush
|
||||
Login;Name;Email~petrenko;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com|<7C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> petrenko
|
||||
Login;Name;Email~petrenko;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;petrenko2@mail.com~ivanenko;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;ivanenko@mail.com~obama;Barack Hussein Obama;obama@gmail.com|<7C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> petrenko~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ivanenko~Obama Barack Hussein obama
|
||||
Login;Name;Email~obama;Barack Hussein Obama;obama@gmail.com~obama;Barack Hussein Obama;obama@gmail.com|Obama Barack Hussein obama~Obama Barack Hussein obama
|
||||
Login;Name;Email~a;b c d;e@f.g~h;i j k;l@n.n|d b c a~k i j h
|
|
@ -0,0 +1,48 @@
|
||||
|
||||
When I was younger, so much younger than today
|
||||
I never needed anybody's help in any way
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
1
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
1: I
|
||||
|
||||
====================================
|
||||
|
||||
When I was younger, so much younger than today
|
||||
I never needed anybody's help in any way
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
2
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
2: so in
|
||||
|
||||
====================================
|
||||
|
||||
When I was younger, so much younger than today
|
||||
I never needed anybody's help in any way
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. ³<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>䳿 <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
5
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
5: today never <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. <20><>䳿 <20><><EFBFBD><EFBFBD>.
|
||||
|
||||
====================================
|
||||
|
||||
When I was younger, so much younger than today
|
||||
I never needed anybody's help in any way
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. ³<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>䳿 <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
6
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
6: needed <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD>.
|
||||
|
||||
====================================
|
||||
|
||||
When I was younger, so much younger than today
|
||||
I never needed anybody's help in any way
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. ³<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>䳿 <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
8
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
8: younger,
|
||||
|
||||
====================================
|
@ -0,0 +1,9 @@
|
||||
a b a abc bca abc abcde abcdf|1|1: a b
|
||||
a b a abc bca abc abcde abcdf|2|2: abc bca
|
||||
a b a abc bca abc abcde abcdf|3|3: abcde abcdf
|
||||
a b a abc bca abc abcde abcdf|4|
|
||||
When I was younger, so much younger than today~I never needed anybody's help in any way|1|1: I
|
||||
When I was younger, so much younger than today~I never needed anybody's help in any way|2|2: so in
|
||||
When I was younger, so much younger than today~I never needed anybody's help in any way~<7E><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. ³<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>䳿 <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.|5|5: today never <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. <20><>䳿 <20><><EFBFBD><EFBFBD>.
|
||||
When I was younger, so much younger than today~I never needed anybody's help in any way~<7E><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. ³<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>䳿 <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.|6|6: needed <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD>.
|
||||
When I was younger, so much younger than today~I never needed anybody's help in any way~<7E><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. ³<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>䳿 <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.|8|8: younger,
|
|
@ -0,0 +1,54 @@
|
||||
|
||||
when I was younger younger than today was
|
||||
I never needed needed never never was I was
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
when I was younger YOUNGER than today WAS
|
||||
i never needed NEEDED NEVER never was I WAS
|
||||
|
||||
====================================
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. ³<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>䳿 <20><><EFBFBD><EFBFBD>.
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.
|
||||
<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. ³<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>䳿 <20><><EFBFBD><EFBFBD>.
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.
|
||||
<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>Ͳ, <20><><EFBFBD><EFBFBD><EFBFBD>² <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
|
||||
====================================
|
||||
|
||||
asdf adsf asdfa sd fa sdf adfa sdfa
|
||||
asdfas dfasd
|
||||
asd f
|
||||
asdfasdfasdf
|
||||
asdf asdf asdf asdf a sdf
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
asdf adsf asdfa sd fa sdf adfa sdfa
|
||||
asdfas dfasd
|
||||
asd f
|
||||
asdfasdfasdf
|
||||
ASDF asdf ASDF asdf a SDF
|
||||
|
||||
====================================
|
||||
|
||||
a b c a b c a b c
|
||||
b c b c a b c a
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
a b c A B C a b c
|
||||
B C b c A B C a
|
||||
|
||||
====================================
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
====================================
|
@ -0,0 +1,5 @@
|
||||
when I was younger younger than today was~I never needed needed never never was I was|when I was younger YOUNGER than today WAS~i never needed NEEDED NEVER never was I WAS
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. ³<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>䳿 <20><><EFBFBD><EFBFBD>. ~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. ~<7E><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.~<7E><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. ~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. |<7C><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. ³<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>䳿 <20><><EFBFBD><EFBFBD>. ~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. ~<7E><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.~<7E><><EFBFBD> <20><><EFBFBD>Ͳ, <20><><EFBFBD><EFBFBD><EFBFBD>² <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. ~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
asdf adsf asdfa sd fa sdf adfa sdfa ~asdfas dfasd~asd f~asdfasdfasdf~asdf asdf asdf asdf a sdf |asdf adsf asdfa sd fa sdf adfa sdfa ~asdfas dfasd~asd f~asdfasdfasdf~ASDF asdf ASDF asdf a SDF
|
||||
a b c a b c a b c~b c b c a b c a |a b c A B C a b c~B C b c A B C a
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>~<7E><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> |<7C><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>~<7E><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|
BIN
semester-4/ОПJа/lb-3/tasks.pdf
Normal file
BIN
semester-4/ОПJа/lb-3/tasks.pdf
Normal file
Binary file not shown.
BIN
semester-4/ОПJа/lb-4/part5-gifs/part5-demo-1.gif
Normal file
BIN
semester-4/ОПJа/lb-4/part5-gifs/part5-demo-1.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
BIN
semester-4/ОПJа/lb-4/part5-gifs/part5-demo-2.gif
Normal file
BIN
semester-4/ОПJа/lb-4/part5-gifs/part5-demo-2.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 69 KiB |
BIN
semester-4/ОПJа/lb-4/part5-gifs/part5-demo-3.gif
Normal file
BIN
semester-4/ОПJа/lb-4/part5-gifs/part5-demo-3.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
BIN
semester-4/ОПJа/lb-4/part5-gifs/part5-demo-4.gif
Normal file
BIN
semester-4/ОПJа/lb-4/part5-gifs/part5-demo-4.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 33 KiB |
202
semester-4/ОПJа/lb-4/task4/.gitignore
vendored
Normal file
202
semester-4/ОПJа/lb-4/task4/.gitignore
vendored
Normal file
@ -0,0 +1,202 @@
|
||||
/target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
|
||||
# Created by https://www.gitignore.io/api/git,java,maven,eclipse,windows
|
||||
|
||||
### Eclipse ###
|
||||
|
||||
.metadata
|
||||
bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
*.bak
|
||||
*.swp
|
||||
*~.nib
|
||||
local.properties
|
||||
.settings/
|
||||
.loadpath
|
||||
.recommenders
|
||||
|
||||
# External tool builders
|
||||
.externalToolBuilders/
|
||||
|
||||
# Locally stored "Eclipse launch configurations"
|
||||
*.launch
|
||||
|
||||
# PyDev specific (Python IDE for Eclipse)
|
||||
*.pydevproject
|
||||
|
||||
# CDT-specific (C/C++ Development Tooling)
|
||||
.cproject
|
||||
|
||||
# CDT- autotools
|
||||
.autotools
|
||||
|
||||
# Java annotation processor (APT)
|
||||
.factorypath
|
||||
|
||||
# PDT-specific (PHP Development Tools)
|
||||
.buildpath
|
||||
|
||||
# sbteclipse plugin
|
||||
.target
|
||||
|
||||
# Tern plugin
|
||||
.tern-project
|
||||
|
||||
# TeXlipse plugin
|
||||
.texlipse
|
||||
|
||||
# STS (Spring Tool Suite)
|
||||
.springBeans
|
||||
|
||||
# Code Recommenders
|
||||
.recommenders/
|
||||
|
||||
# Annotation Processing
|
||||
.apt_generated/
|
||||
|
||||
# Scala IDE specific (Scala & Java development for Eclipse)
|
||||
.cache-main
|
||||
.scala_dependencies
|
||||
.worksheet
|
||||
|
||||
### Eclipse Patch ###
|
||||
# Eclipse Core
|
||||
.project
|
||||
|
||||
# JDT-specific (Eclipse Java Development Tools)
|
||||
.classpath
|
||||
|
||||
# Annotation Processing
|
||||
.apt_generated
|
||||
|
||||
.sts4-cache/
|
||||
|
||||
### Git ###
|
||||
# Created by git for backups. To disable backups in Git:
|
||||
# $ git config --global mergetool.keepBackup false
|
||||
*.orig
|
||||
|
||||
# Created by git when using merge tools for conflicts
|
||||
*.BACKUP.*
|
||||
*.BASE.*
|
||||
*.LOCAL.*
|
||||
*.REMOTE.*
|
||||
*_BACKUP_*.txt
|
||||
*_BASE_*.txt
|
||||
*_LOCAL_*.txt
|
||||
*_REMOTE_*.txt
|
||||
|
||||
### Java ###
|
||||
# Compiled class file
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
*.log
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
||||
### Maven ###
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
### Windows ###
|
||||
# Windows thumbnail cache files
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
|
||||
# Dump file
|
||||
*.stackdump
|
||||
|
||||
# Folder config file
|
||||
[Dd]esktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Some additional ignores (sort later)
|
||||
*.DS_Store
|
||||
*.sw?
|
||||
.#*
|
||||
*#
|
||||
*~
|
||||
.classpath
|
||||
.project
|
||||
.settings
|
||||
bin
|
||||
build
|
||||
target
|
||||
dependency-reduced-pom.xml
|
||||
*.sublime-*
|
||||
/scratch
|
||||
.gradle
|
||||
README.html
|
||||
*.iml
|
||||
.idea
|
||||
.exercism
|
||||
|
2
semester-4/ОПJа/lb-4/task4/mvn-clean-test.bat
Normal file
2
semester-4/ОПJа/lb-4/task4/mvn-clean-test.bat
Normal file
@ -0,0 +1,2 @@
|
||||
set JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
|
||||
mvn clean test
|
2
semester-4/ОПJа/lb-4/task4/mvn-clean-test.sh
Normal file
2
semester-4/ОПJа/lb-4/task4/mvn-clean-test.sh
Normal file
@ -0,0 +1,2 @@
|
||||
JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
|
||||
mvn clean test
|
5
semester-4/ОПJа/lb-4/task4/part1.txt
Normal file
5
semester-4/ОПJа/lb-4/task4/part1.txt
Normal file
@ -0,0 +1,5 @@
|
||||
Сонце гріє лице,
|
||||
Радує це!
|
||||
Ooh
|
||||
What more
|
||||
can I say
|
3
semester-4/ОПJа/lb-4/task4/part2.txt
Normal file
3
semester-4/ОПJа/lb-4/task4/part2.txt
Normal file
@ -0,0 +1,3 @@
|
||||
asd asdf asd asdf
|
||||
asdf 43 asdsf 43 43 434
|
||||
stop
|
1
semester-4/ОПJа/lb-4/task4/part4_sorted.txt
Normal file
1
semester-4/ОПJа/lb-4/task4/part4_sorted.txt
Normal file
@ -0,0 +1 @@
|
||||
0
|
45
semester-4/ОПJа/lb-4/task4/pom.xml
Normal file
45
semester-4/ОПJа/lb-4/task4/pom.xml
Normal file
@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>ua.nure.jfn</groupId>
|
||||
<artifactId>task4</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.release>17</maven.compiler.release>
|
||||
<junit5.version>5.12.0</junit5.version>
|
||||
<surefire.version>3.5.3</surefire.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
<version>${junit5.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-params</artifactId>
|
||||
<version>${junit5.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>task4</finalName>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${surefire.version}</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
</project>
|
@ -0,0 +1,37 @@
|
||||
package ua.nure.jfn.task4;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class Demo {
|
||||
|
||||
public static void main(String[] args) {
|
||||
String symin;
|
||||
InputStream stdin = System.in;
|
||||
|
||||
// Part1
|
||||
symin = "asdf\n" +
|
||||
"Latn\n" +
|
||||
"Cyrl\n" +
|
||||
"Stop\n";
|
||||
System.setIn(new ByteArrayInputStream(symin.getBytes(StandardCharsets.UTF_8)));
|
||||
|
||||
Part1.main(args);
|
||||
// ~Part1
|
||||
|
||||
// Part3
|
||||
symin = "table en\n" +
|
||||
"table uk\n" +
|
||||
"apple en\n" +
|
||||
"asfd asdf\n" +
|
||||
"apple uk\n" +
|
||||
"stop\n";
|
||||
System.setIn(new ByteArrayInputStream(symin.getBytes(StandardCharsets.UTF_8)));
|
||||
|
||||
Part3.main(args);
|
||||
// ~Part3
|
||||
|
||||
System.setIn(stdin);
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package ua.nure.jfn.task4;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Scanner;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class Part1 {
|
||||
|
||||
private static final String PATH = "part1.txt";
|
||||
private static final Pattern LATN_PATTERN = Pattern.compile("\\b\\p{IsLatin}+\\b",
|
||||
Pattern.UNICODE_CHARACTER_CLASS);
|
||||
private static final Pattern CYRL_PATTERN = Pattern.compile("\\b\\p{IsCyrillic}+\\b",
|
||||
Pattern.UNICODE_CHARACTER_CLASS);
|
||||
|
||||
public static void main(String[] args) {
|
||||
Scanner scanner = new Scanner(System.in);
|
||||
|
||||
String fileContent = null;
|
||||
try {
|
||||
fileContent = new String(Files.readAllBytes(Paths.get(PATH)));
|
||||
} catch (IOException ex) {
|
||||
ex.printStackTrace();
|
||||
scanner.close();
|
||||
return;
|
||||
}
|
||||
|
||||
String result;
|
||||
String input;
|
||||
while (scanner.hasNextLine()) {
|
||||
input = scanner.nextLine();
|
||||
|
||||
if (input.equalsIgnoreCase("stop")) {
|
||||
break;
|
||||
} else if (input.equals("Latn")) {
|
||||
result = extractWords(fileContent, LATN_PATTERN);
|
||||
} else if (input.equals("Cyrl")) {
|
||||
result = extractWords(fileContent, CYRL_PATTERN);
|
||||
} else {
|
||||
result = "Incorrect input";
|
||||
}
|
||||
|
||||
System.out.printf("%s: %s\n", input, result);
|
||||
}
|
||||
scanner.close();
|
||||
}
|
||||
|
||||
private static String extractWords(String text, Pattern pattern) {
|
||||
String words = "";
|
||||
Matcher matcher = pattern.matcher(text);
|
||||
|
||||
while (matcher.find())
|
||||
words += " " + matcher.group();
|
||||
|
||||
return words.trim();
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package ua.nure.jfn.task4;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class Part2 {
|
||||
|
||||
public static void main(String[] args) {
|
||||
String symin = "asdf\n" +
|
||||
"asdf\n" +
|
||||
"fdsa\n" +
|
||||
"Stop\n";
|
||||
|
||||
InputStream stdin = System.in;
|
||||
|
||||
System.setIn(new ByteArrayInputStream(symin.getBytes(StandardCharsets.UTF_8)));
|
||||
|
||||
WordContainer.main(args);
|
||||
|
||||
System.setIn(stdin);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package ua.nure.jfn.task4;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Part3 {
|
||||
|
||||
private static final String BASE_NAME = "resources";
|
||||
|
||||
public static void main(String[] args) {
|
||||
Scanner scanner = new Scanner(System.in);
|
||||
|
||||
String input;
|
||||
while (scanner.hasNextLine()) {
|
||||
input = scanner.nextLine();
|
||||
|
||||
if (input.equalsIgnoreCase("stop")) {
|
||||
break;
|
||||
}
|
||||
|
||||
String[] parts = input.split(" ");
|
||||
|
||||
Locale locale = new Locale(parts[1]);
|
||||
ResourceBundle bundle = ResourceBundle.getBundle(BASE_NAME, locale);
|
||||
System.out.println(bundle.getString(parts[0]));
|
||||
}
|
||||
scanner.close();
|
||||
}
|
||||
}
|
@ -0,0 +1,110 @@
|
||||
package ua.nure.jfn.task4;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class Part4 {
|
||||
|
||||
private static final Path INPUT_FILE = Paths.get("part4.txt");
|
||||
private static final Path OUTPUT_FILE = Paths.get("part4_sorted.txt");
|
||||
|
||||
private static final int NUM_INTEGERS = 10;
|
||||
private static final int MAX_VALUE = 50;
|
||||
|
||||
public static void main(String[] args) {
|
||||
List<Integer> nums;
|
||||
|
||||
if (!Files.exists(INPUT_FILE)) {
|
||||
Random random = new Random();
|
||||
|
||||
nums = new ArrayList<Integer>(NUM_INTEGERS);
|
||||
for (int i = 0; i < NUM_INTEGERS; i++) {
|
||||
nums.add(random.nextInt(MAX_VALUE + 1));
|
||||
}
|
||||
|
||||
if (!tryWriteNums(INPUT_FILE, nums)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
nums = tryReadNums(INPUT_FILE);
|
||||
if (nums == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.printf("input ==> %s\n", joinInts(nums));
|
||||
|
||||
nums = sortDedup(nums);
|
||||
if (!tryWriteNums(OUTPUT_FILE, nums)) {
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.printf("output ==> %s\n", joinInts(nums));
|
||||
}
|
||||
|
||||
private static List<Integer> sortDedup(List<Integer> nums) {
|
||||
for (int i = 0; i < nums.size() - 1; i++) {
|
||||
for (int j = 0; j < nums.size() - i - 1; j++) {
|
||||
int a = nums.get(j);
|
||||
int b = nums.get(j + 1);
|
||||
|
||||
if (a > b) {
|
||||
nums.set(j, b);
|
||||
nums.set(j + 1, a);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<Integer> dedup = new ArrayList<Integer>();
|
||||
for (int num : nums) {
|
||||
if (dedup.indexOf(num) == -1)
|
||||
dedup.add(num);
|
||||
}
|
||||
|
||||
return dedup;
|
||||
}
|
||||
|
||||
private static boolean tryWriteNums(Path path, List<Integer> nums) {
|
||||
try {
|
||||
String s = "";
|
||||
for (int i = 0; i < nums.size(); i++) {
|
||||
s += " " + nums.get(i);
|
||||
}
|
||||
|
||||
Files.write(path, s.trim().getBytes(StandardCharsets.UTF_8));
|
||||
} catch (IOException e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static List<Integer> tryReadNums(Path path) {
|
||||
List<Integer> nums = new ArrayList<Integer>(NUM_INTEGERS);
|
||||
try {
|
||||
String content = Files.readString(path);
|
||||
for (String s : content.trim().split(" ")) {
|
||||
nums.add(Integer.parseInt(s));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return nums;
|
||||
}
|
||||
|
||||
private static String joinInts(Iterable<Integer> numbers) {
|
||||
String result = "";
|
||||
for (int num : numbers) {
|
||||
result += " " + num;
|
||||
}
|
||||
|
||||
return result.trim();
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package ua.nure.jfn.task4;
|
||||
|
||||
public class Part5 {
|
||||
|
||||
private static final String SEPARATOR = "~~~~~~~";
|
||||
|
||||
public static void main(String[] args) {
|
||||
Tree<Integer> tree = new Tree<>();
|
||||
|
||||
System.out.println(tree.add(3));
|
||||
System.out.println(tree.add(3));
|
||||
|
||||
System.out.println(SEPARATOR);
|
||||
tree.add(new Integer[] { 1, 2, 6, 4, 7, 0, 5 });
|
||||
tree.print();
|
||||
|
||||
System.out.println(SEPARATOR);
|
||||
System.out.println(tree.remove(5));
|
||||
System.out.println(tree.remove(5));
|
||||
|
||||
System.out.println(SEPARATOR);
|
||||
tree.print();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,194 @@
|
||||
package ua.nure.jfn.task4;
|
||||
|
||||
public class Tree<E extends Comparable<E>> {
|
||||
private Node<E> root;
|
||||
private int size;
|
||||
|
||||
public Tree() {
|
||||
root = null;
|
||||
size = 0;
|
||||
}
|
||||
|
||||
public boolean add(E element) {
|
||||
if (element == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int oldSize = size;
|
||||
root = addRecursive(root, element);
|
||||
return size > oldSize;
|
||||
}
|
||||
|
||||
private Node<E> addRecursive(Node<E> node, E element) {
|
||||
if (node == null) {
|
||||
size++;
|
||||
return new Node<>(element);
|
||||
}
|
||||
|
||||
int comparison = element.compareTo(node.data);
|
||||
|
||||
if (comparison < 0) {
|
||||
node.left = addRecursive(node.left, element);
|
||||
} else if (comparison > 0) {
|
||||
node.right = addRecursive(node.right, element);
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
public void add(E[] elements) {
|
||||
if (elements == null) {
|
||||
throw new IllegalArgumentException("Array cannot be null");
|
||||
}
|
||||
for (E e : elements) {
|
||||
if (e != null) {
|
||||
add(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean remove(E element) {
|
||||
if (element == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int oldSize = size;
|
||||
root = removeRecursive(root, element);
|
||||
return size < oldSize;
|
||||
}
|
||||
|
||||
private Node<E> removeRecursive(Node<E> node, E element) {
|
||||
if (node == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
int comparison = element.compareTo(node.data);
|
||||
|
||||
if (comparison < 0) {
|
||||
node.left = removeRecursive(node.left, element);
|
||||
} else if (comparison > 0) {
|
||||
node.right = removeRecursive(node.right, element);
|
||||
} else {
|
||||
size--;
|
||||
|
||||
if (node.left == null && node.right == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (node.left == null) {
|
||||
return node.right;
|
||||
}
|
||||
|
||||
if (node.right == null) {
|
||||
return node.left;
|
||||
}
|
||||
|
||||
Node<E> successor = findMin(node.right);
|
||||
node.data = successor.data;
|
||||
node.right = removeRecursive(node.right, successor.data);
|
||||
size++;
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
private Node<E> findMin(Node<E> node) {
|
||||
while (node.left != null) {
|
||||
node = node.left;
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
public boolean contains(E element) {
|
||||
if (element == null) {
|
||||
return false;
|
||||
}
|
||||
return containsRecursive(root, element);
|
||||
}
|
||||
|
||||
private boolean containsRecursive(Node<E> node, E element) {
|
||||
if (node == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int comparison = element.compareTo(node.data);
|
||||
|
||||
if (comparison == 0) {
|
||||
return true;
|
||||
} else if (comparison < 0) {
|
||||
return containsRecursive(node.left, element);
|
||||
} else {
|
||||
return containsRecursive(node.right, element);
|
||||
}
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
root = null;
|
||||
size = 0;
|
||||
}
|
||||
|
||||
public void print() {
|
||||
if (root == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String pad = " ".repeat(root.width());
|
||||
|
||||
if (root.left != null) {
|
||||
root.left.print(pad, "┌", false);
|
||||
}
|
||||
|
||||
System.out.printf("%s%s\n", root.data, root.pointer());
|
||||
|
||||
if (root.right != null) {
|
||||
root.right.print(pad, "└", true);
|
||||
}
|
||||
}
|
||||
|
||||
private static class Node<E> {
|
||||
E data;
|
||||
Node<E> left;
|
||||
Node<E> right;
|
||||
|
||||
Node(E data) {
|
||||
this.data = data;
|
||||
this.left = null;
|
||||
this.right = null;
|
||||
}
|
||||
|
||||
int width() {
|
||||
return data.toString().length();
|
||||
}
|
||||
|
||||
String pointer() {
|
||||
if (right != null && left != null) {
|
||||
return "┤";
|
||||
} else if (right != null) {
|
||||
return "┐";
|
||||
} else if (left != null) {
|
||||
return "┘";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public void print(String prev, String handle, boolean nested) {
|
||||
String pad = " ".repeat(width());
|
||||
String ptr = pointer();
|
||||
|
||||
if (left != null) {
|
||||
left.print(prev + (nested ? "│" : " ") + pad, "┌", false);
|
||||
}
|
||||
|
||||
System.out.printf("%s%s%s%s\n", prev, handle, data, ptr);
|
||||
|
||||
if (right != null) {
|
||||
right.print(prev + (!nested ? "│" : " ") + pad, "└", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package ua.nure.jfn.task4;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class Word implements Comparable<Word> {
|
||||
private String content;
|
||||
private int frequency;
|
||||
|
||||
public Word(String content) {
|
||||
this.content = content;
|
||||
this.frequency = 1;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public int getFrequency() {
|
||||
return frequency;
|
||||
}
|
||||
|
||||
public void incrementFrequency() {
|
||||
this.frequency++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Word word = (Word) o;
|
||||
|
||||
return content.equals(word.content);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(content);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return content + " : " + frequency;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Word other) {
|
||||
int frequencyComparison = Integer.compare(this.frequency, other.frequency);
|
||||
|
||||
if (frequencyComparison != 0) {
|
||||
return frequencyComparison;
|
||||
}
|
||||
|
||||
return this.content.compareTo(other.content);
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package ua.nure.jfn.task4;
|
||||
|
||||
import java.util.Scanner;
|
||||
import java.util.ArrayList;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class WordContainer {
|
||||
|
||||
private static Pattern WORD_PATTERN = Pattern.compile("\\S+");
|
||||
|
||||
private ArrayList<Word> words = new ArrayList<>();
|
||||
|
||||
public static void main(String[] args) {
|
||||
WordContainer container = new WordContainer();
|
||||
container.readAndProcessInput();
|
||||
container.printWords();
|
||||
}
|
||||
|
||||
private void readAndProcessInput() {
|
||||
Scanner scanner = new Scanner(System.in);
|
||||
|
||||
String input;
|
||||
outer: while (scanner.hasNextLine()) {
|
||||
input = scanner.nextLine();
|
||||
|
||||
Matcher matcher = WORD_PATTERN.matcher(input);
|
||||
while (matcher.find()) {
|
||||
String wordContent = matcher.group();
|
||||
|
||||
if (wordContent.equalsIgnoreCase("stop"))
|
||||
break outer;
|
||||
|
||||
addWord(wordContent);
|
||||
}
|
||||
}
|
||||
scanner.close();
|
||||
}
|
||||
|
||||
private void addWord(String content) {
|
||||
Word newWord = new Word(content);
|
||||
|
||||
int i = words.indexOf(newWord);
|
||||
if (i == -1) {
|
||||
words.add(newWord);
|
||||
} else {
|
||||
words.get(i).incrementFrequency();
|
||||
}
|
||||
}
|
||||
|
||||
private void printWords() {
|
||||
words.sort(null);
|
||||
for (Word word : words)
|
||||
System.out.println(word);
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
table = table
|
||||
apple = apple
|
@ -0,0 +1,2 @@
|
||||
table = \u0441\u0442\u0456\u043b
|
||||
apple = \u044f\u0431\u043b\u0443\u043a\u043e
|
@ -0,0 +1,67 @@
|
||||
package ua.nure.jfn.task4;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.PrintStream;
|
||||
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.CsvFileSource;
|
||||
|
||||
/**
|
||||
* @author Dmytro Kolesnykov
|
||||
*/
|
||||
public class Part1Test {
|
||||
|
||||
private static final InputStream STD_IN = System.in;
|
||||
|
||||
private static final PrintStream STD_OUT = System.out;
|
||||
|
||||
private static final String ENCODING = "UTF-8";
|
||||
|
||||
private static final String EOL_CHAR = "~";
|
||||
|
||||
private static final String[] EMPTY_ARGS = {};
|
||||
|
||||
private static final String INPUT_FILE = "part1.txt";
|
||||
|
||||
private static final String EOL = System.lineSeparator();
|
||||
|
||||
private final ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
|
||||
private final PrintStream out = new PrintStream(baos);
|
||||
|
||||
private static String toMultiline(String line) {
|
||||
return line.replaceAll(EOL_CHAR, EOL).trim();
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@CsvFileSource(resources = "part1.csv", delimiter = ';')
|
||||
void part1(String data, String consoleInput, String expectedLine) throws Exception {
|
||||
String expected = toMultiline(expectedLine);
|
||||
String input = toMultiline(consoleInput);
|
||||
byte[] buf = input.getBytes(ENCODING);
|
||||
ByteArrayInputStream bais = new ByteArrayInputStream(buf);
|
||||
System.setOut(out);
|
||||
System.setIn(bais);
|
||||
String actual = "";
|
||||
byte[] content = null;
|
||||
try {
|
||||
content = Utils.getContent(INPUT_FILE);
|
||||
Utils.saveContent(INPUT_FILE, toMultiline(data).getBytes(ENCODING));
|
||||
|
||||
Part1.main(EMPTY_ARGS);
|
||||
|
||||
out.flush();
|
||||
actual = baos.toString();
|
||||
} finally {
|
||||
System.setOut(STD_OUT);
|
||||
System.setIn(STD_IN);
|
||||
Utils.saveContent(INPUT_FILE, content);
|
||||
}
|
||||
assertEquals(expected.trim(), actual.trim());
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package ua.nure.jfn.task4;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.PrintStream;
|
||||
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.CsvFileSource;
|
||||
|
||||
/**
|
||||
* @author Dmytro Kolesnykov
|
||||
*/
|
||||
public class Part2Test {
|
||||
|
||||
private static final InputStream STD_IN = System.in;
|
||||
|
||||
private static final PrintStream STD_OUT = System.out;
|
||||
|
||||
private static final String TEST_DATA_FILE_ENCODINE = "UTF-8";
|
||||
|
||||
private static final String EOL_CHAR = "~";
|
||||
|
||||
private static final String[] EMPTY_ARGS = {};
|
||||
|
||||
private final ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
|
||||
private final PrintStream out = new PrintStream(baos);
|
||||
|
||||
@ParameterizedTest
|
||||
@CsvFileSource(resources = "part2.csv", delimiter = ';')
|
||||
void part2(String inputLine, String expectedLine) throws Exception {
|
||||
String input = inputLine.replace(EOL_CHAR, System.lineSeparator());
|
||||
String expected = expectedLine.replace(EOL_CHAR, System.lineSeparator());
|
||||
byte[] buf = input.getBytes(TEST_DATA_FILE_ENCODINE);
|
||||
ByteArrayInputStream bais = new ByteArrayInputStream(buf);
|
||||
System.setOut(out);
|
||||
System.setIn(bais);
|
||||
try {
|
||||
WordContainer.main(EMPTY_ARGS);
|
||||
|
||||
out.flush();
|
||||
String actual = baos.toString();
|
||||
assertEquals(expected.trim(), actual.trim());
|
||||
} finally {
|
||||
System.setOut(STD_OUT);
|
||||
System.setIn(STD_IN);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,111 @@
|
||||
package ua.nure.jfn.task4;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.PrintStream;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.nio.file.DirectoryStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.CsvFileSource;
|
||||
|
||||
/**
|
||||
* @author Dmytro Kolesnykov
|
||||
*/
|
||||
public class Part3Test {
|
||||
|
||||
private static final InputStream STD_IN = System.in;
|
||||
|
||||
private static final PrintStream STD_OUT = System.out;
|
||||
|
||||
private static final String TEST_DATA_FILE_ENCODINE = "UTF-8";
|
||||
|
||||
private static final String EOL_CHAR = "~";
|
||||
|
||||
private static final String[] EMPTY_ARGS = {};
|
||||
|
||||
private static final String EOL = System.lineSeparator();
|
||||
|
||||
private static final String BASE_NAME = "resources";
|
||||
|
||||
private final ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
|
||||
private final PrintStream out = new PrintStream(baos);
|
||||
|
||||
private static String toMultiline(String line) {
|
||||
return line.replaceAll(EOL_CHAR, EOL).trim();
|
||||
}
|
||||
|
||||
private static String removeCR(String s) {
|
||||
return s.replaceAll("\r?", "");
|
||||
}
|
||||
|
||||
private static final URI classPathURI;
|
||||
|
||||
static {
|
||||
try {
|
||||
classPathURI = Part3.class.getProtectionDomain().getCodeSource().getLocation().toURI();
|
||||
} catch (URISyntaxException ex) {
|
||||
throw new IllegalStateException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@CsvFileSource(resources = "part3.csv", delimiter = ';')
|
||||
void part3(String defaultLocale, String localesString, String consoleInput, String expectedLine) throws Exception {
|
||||
ResourceBundle.clearCache();
|
||||
Locale.setDefault(new Locale(defaultLocale));
|
||||
|
||||
try (DirectoryStream<Path> stream = Files.newDirectoryStream(Path.of(classPathURI))) {
|
||||
for (Path p : stream) {
|
||||
if (p.toString().endsWith(".properties")) {
|
||||
Files.delete(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Path classPath = Paths.get(classPathURI);
|
||||
List<String> locales = Arrays.asList(localesString.trim().split(" "));
|
||||
String actual = "";
|
||||
InputStream is = null;
|
||||
try {
|
||||
for (String locale : locales) {
|
||||
String bundleName = BASE_NAME + '_' + locale + ".properties";
|
||||
is = getClass().getClassLoader().getResourceAsStream(locale + ".props");
|
||||
try (OutputStream out = new FileOutputStream(new File(classPath.toString(), bundleName))) {
|
||||
is.transferTo(out);
|
||||
is.close();
|
||||
}
|
||||
}
|
||||
String input = toMultiline(consoleInput);
|
||||
byte[] buf = input.getBytes(TEST_DATA_FILE_ENCODINE);
|
||||
ByteArrayInputStream bais = new ByteArrayInputStream(buf);
|
||||
System.setOut(out);
|
||||
System.setIn(bais);
|
||||
|
||||
Part3.main(EMPTY_ARGS);
|
||||
|
||||
out.flush();
|
||||
actual = baos.toString();
|
||||
} finally {
|
||||
System.setOut(STD_OUT);
|
||||
System.setIn(STD_IN);
|
||||
}
|
||||
assertEquals(removeCR(toMultiline(expectedLine)).trim(), removeCR(actual).trim());
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package ua.nure.jfn.task4;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.PrintStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.CsvFileSource;
|
||||
|
||||
/**
|
||||
* @author Dmytro Kolesnykov
|
||||
*/
|
||||
public class Part4Test {
|
||||
|
||||
private static final InputStream STD_IN = System.in;
|
||||
|
||||
private static final PrintStream STD_OUT = System.out;
|
||||
|
||||
private static final String EOL_CHAR = "~";
|
||||
|
||||
private static final String[] EMPTY_ARGS = {};
|
||||
|
||||
private static final String INPUT_FILE = "part4.txt";
|
||||
|
||||
private static final String EOL = System.lineSeparator();
|
||||
|
||||
private final ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
|
||||
private final PrintStream out = new PrintStream(baos);
|
||||
|
||||
private static String toMultiline(String line) {
|
||||
return line.replaceAll(EOL_CHAR, EOL).trim();
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
static void tearDown() throws IOException {
|
||||
Files.deleteIfExists(Path.of(INPUT_FILE));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@CsvFileSource(resources = "part4.csv", delimiter = ';')
|
||||
void part4(String inputData, String expected) throws Exception {
|
||||
Files.writeString(Paths.get(INPUT_FILE), inputData);
|
||||
System.setOut(out);
|
||||
String actual = "";
|
||||
try {
|
||||
Part4.main(EMPTY_ARGS);
|
||||
|
||||
out.flush();
|
||||
actual = baos.toString();
|
||||
} finally {
|
||||
System.setOut(STD_OUT);
|
||||
System.setIn(STD_IN);
|
||||
}
|
||||
assertEquals(toMultiline(expected).trim(), actual.trim());
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package ua.nure.jfn.task4;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.PrintStream;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.CsvFileSource;
|
||||
|
||||
/**
|
||||
* @author Dmytro Kolesnykov
|
||||
*/
|
||||
public class Part5Test {
|
||||
|
||||
private static final PrintStream STD_OUT = System.out;
|
||||
|
||||
private final ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
|
||||
private final PrintStream out = new PrintStream(baos);
|
||||
|
||||
private static String removeCR(String s) {
|
||||
return s.replaceAll("\r?", "");
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@CsvFileSource(resources = "part5.csv", delimiter = ';', ignoreLeadingAndTrailingWhitespace = false)
|
||||
void part5(String actionsData, String expectedTree) throws Exception {
|
||||
String expected = expectedTree == null
|
||||
? ""
|
||||
: expectedTree.replaceAll("~", System.lineSeparator());
|
||||
|
||||
Tree<Integer> tree = new Tree<>();
|
||||
for (String action : actionsData.split("\\s+")) {
|
||||
String actionName = actionResolver(action.charAt(0));
|
||||
Method actionMethod = Tree.class.getMethod(actionName, Comparable.class);
|
||||
String actionValues = action.substring(action.indexOf('-') + 1);
|
||||
for (String value : actionValues.split("-")) {
|
||||
actionMethod.invoke(tree, new Object[] { Integer.parseInt(value) });
|
||||
}
|
||||
}
|
||||
String actual = null;
|
||||
try {
|
||||
System.setOut(out);
|
||||
|
||||
tree.print();
|
||||
|
||||
out.flush();
|
||||
actual = baos.toString();
|
||||
} finally {
|
||||
System.setOut(STD_OUT);
|
||||
}
|
||||
expected = removeCR(expected).stripTrailing();
|
||||
actual = removeCR(actual.replaceAll("(?m)\\s+$", "").stripTrailing());
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
private static String actionResolver(char actionChar) {
|
||||
switch (actionChar) {
|
||||
case 'a':
|
||||
return "add";
|
||||
case 'r':
|
||||
return "remove";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package ua.nure.jfn.task4;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
public class Utils {
|
||||
|
||||
public static byte[] getContent(String fileName) throws IOException {
|
||||
return Files.readAllBytes(Paths.get(fileName));
|
||||
}
|
||||
|
||||
public static void saveContent(String fileName, byte[] content) throws IOException {
|
||||
if (content != null) {
|
||||
Files.write(Paths.get(fileName), content);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
2
semester-4/ОПJа/lb-4/task4/src/test/resources/en.props
Normal file
2
semester-4/ОПJа/lb-4/task4/src/test/resources/en.props
Normal file
@ -0,0 +1,2 @@
|
||||
table = table
|
||||
apple = apple
|
2
semester-4/ОПJа/lb-4/task4/src/test/resources/ka.props
Normal file
2
semester-4/ОПJа/lb-4/task4/src/test/resources/ka.props
Normal file
@ -0,0 +1,2 @@
|
||||
table = \u10db\u10d0\u10d2\u10d8\u10d3\u10d0
|
||||
apple = \u10d5\u10d0\u10e8\u10da\u10d8
|
@ -0,0 +1,27 @@
|
||||
|
||||
|
||||
|
||||
for f in *-data.txt; do
|
||||
sed -rne '
|
||||
/^#/d
|
||||
/^\s*$/d
|
||||
/^~~~/ {
|
||||
g
|
||||
s/\n/~/g
|
||||
s/$/;/
|
||||
h
|
||||
b
|
||||
}
|
||||
/^===/ {
|
||||
g
|
||||
s/\n/~/g
|
||||
s/;~/;/g
|
||||
s/^~//
|
||||
p
|
||||
s/^.*$//
|
||||
h
|
||||
b
|
||||
}
|
||||
H
|
||||
' $f>${f/-data.txt/.csv}
|
||||
done
|
@ -0,0 +1,72 @@
|
||||
#1
|
||||
Is there anybody
|
||||
going to listen to my story
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
asdf
|
||||
Latn
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
asdf: Incorrect input
|
||||
Latn: Is there anybody going to listen to my story
|
||||
|
||||
====================================
|
||||
|
||||
#2
|
||||
Is there anybody going to listen
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
asdf
|
||||
Latn
|
||||
stop
|
||||
Latn
|
||||
asdf
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
asdf: Incorrect input
|
||||
Latn: Is there anybody going to listen
|
||||
|
||||
====================================
|
||||
|
||||
#3
|
||||
Is there listen
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
asdf
|
||||
Latn
|
||||
Stop
|
||||
Latn
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
asdf: Incorrect input
|
||||
Latn: Is there listen
|
||||
|
||||
====================================
|
||||
|
||||
#4
|
||||
Incorrect input
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
a
|
||||
Latn
|
||||
b
|
||||
stop
|
||||
a
|
||||
Latn
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
a: Incorrect input
|
||||
Latn: Incorrect input
|
||||
b: Incorrect input
|
||||
|
||||
====================================
|
||||
|
||||
#5
|
||||
Сонце гріє лице,
|
||||
Радує це!
|
||||
Ooh, baby, I love you
|
||||
What more
|
||||
can I say
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
latn
|
||||
Latn
|
||||
cyrl
|
||||
Cyrl
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
latn: Incorrect input
|
||||
Latn: Ooh baby I love you What more can I say
|
||||
cyrl: Incorrect input
|
||||
Cyrl: Сонце гріє лице Радує це
|
||||
====================================
|
@ -0,0 +1,5 @@
|
||||
Is there anybody ~going to listen to my story;asdf~Latn;asdf: Incorrect input~Latn: Is there anybody going to listen to my story
|
||||
Is there anybody going to listen;asdf~Latn~stop~Latn~asdf;asdf: Incorrect input~Latn: Is there anybody going to listen
|
||||
Is there listen;asdf~Latn~Stop~Latn;asdf: Incorrect input~Latn: Is there listen
|
||||
Incorrect input;a~Latn~b~stop~a~Latn;a: Incorrect input~Latn: Incorrect input~b: Incorrect input
|
||||
Сонце гріє лице,~ Радує це!~Ooh, baby, I love you~ What more ~can I say;latn~Latn~cyrl~Cyrl;latn: Incorrect input~Latn: Ooh baby I love you What more can I say~cyrl: Incorrect input~Cyrl: Сонце гріє лице Радує це
|
|
@ -0,0 +1,44 @@
|
||||
#1
|
||||
a~b
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
a : 1
|
||||
b : 1
|
||||
|
||||
====================================
|
||||
|
||||
#2
|
||||
a b a d~b c stop b
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
c : 1
|
||||
d : 1
|
||||
a : 2
|
||||
b : 2
|
||||
|
||||
====================================
|
||||
|
||||
#3
|
||||
a b a stop d~b c stop b
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
b : 1
|
||||
a : 2
|
||||
|
||||
====================================
|
||||
|
||||
#4
|
||||
ab ab abd
|
||||
b abd
|
||||
stop
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
b : 1
|
||||
ab : 2
|
||||
abd : 2
|
||||
|
||||
====================================
|
||||
|
||||
#5
|
||||
a a a b b stop c c
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
b : 2
|
||||
a : 3
|
||||
|
||||
====================================
|
@ -0,0 +1,5 @@
|
||||
a~b;a : 1~b : 1
|
||||
a b a d~b c stop b;c : 1~d : 1~a : 2~b : 2
|
||||
a b a stop d~b c stop b;b : 1~a : 2
|
||||
ab ab abd~b abd~stop;b : 1~ab : 2~abd : 2
|
||||
a a a b b stop c c;b : 2~a : 3
|
|
@ -0,0 +1,101 @@
|
||||
#1
|
||||
en
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
en uk
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
table en
|
||||
table ka
|
||||
table uk
|
||||
apple en
|
||||
apple uk
|
||||
stop
|
||||
ka
|
||||
apple
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
table
|
||||
table
|
||||
стіл
|
||||
apple
|
||||
яблуко
|
||||
|
||||
====================================
|
||||
|
||||
#2
|
||||
uk
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
en uk
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
table en
|
||||
table ka
|
||||
table uk
|
||||
apple en
|
||||
apple uk
|
||||
stop
|
||||
ka
|
||||
apple
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
table
|
||||
стіл
|
||||
стіл
|
||||
apple
|
||||
яблуко
|
||||
|
||||
====================================
|
||||
|
||||
#3
|
||||
en
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
en uk ka
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
table en
|
||||
table ka
|
||||
table uk
|
||||
apple en
|
||||
apple uk
|
||||
stop
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
table
|
||||
მაგიდა
|
||||
стіл
|
||||
apple
|
||||
яблуко
|
||||
|
||||
====================================
|
||||
|
||||
#4
|
||||
ka
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
en ka uk
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
table en
|
||||
table ka
|
||||
table uk
|
||||
apple en
|
||||
apple uk
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
table
|
||||
მაგიდა
|
||||
стіл
|
||||
apple
|
||||
яблуко
|
||||
|
||||
====================================
|
||||
|
||||
#5
|
||||
uk
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
en uk
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
table en
|
||||
table en
|
||||
apple uk
|
||||
apple uk
|
||||
stop
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
table
|
||||
table
|
||||
яблуко
|
||||
яблуко
|
||||
|
||||
====================================
|
@ -0,0 +1,5 @@
|
||||
en;en uk;table en~table ka~table uk~apple en~apple uk~stop~ka~apple;table~table~стіл~apple~яблуко
|
||||
uk;en uk;table en~table ka~table uk~apple en~apple uk~stop~ka~apple;table~стіл~стіл~apple~яблуко
|
||||
en;en uk ka;table en~table ka~table uk~apple en~apple uk~stop;table~მაგიდა~стіл~apple~яблуко
|
||||
ka;en ka uk;table en~table ka~table uk~apple en~apple uk;table~მაგიდა~стіл~apple~яблуко
|
||||
uk;en uk;table en~table en~apple uk~apple uk~stop;table~table~яблуко~яблуко
|
|
@ -0,0 +1,39 @@
|
||||
#1
|
||||
1 2 3 4 5 4 3 2 1
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
input ==> 1 2 3 4 5 4 3 2 1
|
||||
output ==> 1 2 3 4 5
|
||||
|
||||
====================================
|
||||
|
||||
#2
|
||||
4 3 1 3 4 1 3 4 1 3 4
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
input ==> 4 3 1 3 4 1 3 4 1 3 4
|
||||
output ==> 1 3 4
|
||||
|
||||
====================================
|
||||
|
||||
#3
|
||||
4 9 8 2 9 4 8 9 1 9
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
input ==> 4 9 8 2 9 4 8 9 1 9
|
||||
output ==> 1 2 4 8 9
|
||||
|
||||
====================================
|
||||
|
||||
#4
|
||||
11 12 11 18 12 11 18 17
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
input ==> 11 12 11 18 12 11 18 17
|
||||
output ==> 11 12 17 18
|
||||
|
||||
====================================
|
||||
|
||||
#5
|
||||
0
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
input ==> 0
|
||||
output ==> 0
|
||||
|
||||
====================================
|
@ -0,0 +1,5 @@
|
||||
1 2 3 4 5 4 3 2 1;input ==> 1 2 3 4 5 4 3 2 1~output ==> 1 2 3 4 5
|
||||
4 3 1 3 4 1 3 4 1 3 4;input ==> 4 3 1 3 4 1 3 4 1 3 4~output ==> 1 3 4
|
||||
4 9 8 2 9 4 8 9 1 9;input ==> 4 9 8 2 9 4 8 9 1 9~output ==> 1 2 4 8 9
|
||||
11 12 11 18 12 11 18 17;input ==> 11 12 11 18 12 11 18 17~output ==> 11 12 17 18
|
||||
0;input ==> 0~output ==> 0
|
|
@ -0,0 +1,199 @@
|
||||
#1
|
||||
a-3
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
3
|
||||
|
||||
====================================
|
||||
|
||||
#2
|
||||
a-3-1-2-6-4-7-0-5
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
┌0
|
||||
┌1┤
|
||||
│ └2
|
||||
3┤
|
||||
│ ┌4┐
|
||||
│ │ └5
|
||||
└6┤
|
||||
└7
|
||||
|
||||
====================================
|
||||
|
||||
#3
|
||||
a-3-1-2-6-4-7-0-5 r-3
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
┌0
|
||||
┌1┤
|
||||
│ └2
|
||||
4┤
|
||||
│ ┌5
|
||||
└6┤
|
||||
└7
|
||||
|
||||
====================================
|
||||
|
||||
#4
|
||||
a-3-1-2-6-4-7-0-5 r-3-5
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
┌0
|
||||
┌1┤
|
||||
│ └2
|
||||
4┤
|
||||
└6┐
|
||||
└7
|
||||
|
||||
====================================
|
||||
|
||||
#5
|
||||
a-3-1-2-6-4-7-0-5 r-3-5-4
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
┌0
|
||||
┌1┤
|
||||
│ └2
|
||||
6┤
|
||||
└7
|
||||
|
||||
====================================
|
||||
|
||||
#6
|
||||
a-3-1-2-6-4-7-0-5 r-3-5-4-1
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
┌0
|
||||
┌2┘
|
||||
6┤
|
||||
└7
|
||||
|
||||
====================================
|
||||
|
||||
#7
|
||||
a-3-1-2-6-4-7-0 r-3-5-4-1
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
┌0
|
||||
┌2┘
|
||||
6┤
|
||||
└7
|
||||
|
||||
====================================
|
||||
|
||||
#8
|
||||
a-3-1-2-6-4-7-0-5 r-3-5-4-1-6-7-2-0-0 a-3-2
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
┌2
|
||||
3┘
|
||||
|
||||
====================================
|
||||
|
||||
#9
|
||||
a-3-3-2-2-1-1 r-2-1
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
3
|
||||
|
||||
====================================
|
||||
|
||||
#10
|
||||
a-3-3-1-1
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
┌1
|
||||
3┘
|
||||
|
||||
====================================
|
||||
|
||||
#11
|
||||
a-3-1-2-6-4-7-0-5 r-3-4-5-6
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
┌0
|
||||
┌1┤
|
||||
│ └2
|
||||
7┘
|
||||
|
||||
====================================
|
||||
|
||||
#12
|
||||
a-3-12-116-14-7-0-5 r-3
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
┌0
|
||||
5┤
|
||||
│ ┌7
|
||||
└12┤
|
||||
│ ┌14
|
||||
└116┘
|
||||
|
||||
====================================
|
||||
|
||||
#13
|
||||
a-3-1-2-6-4-7-0-5 r-3-4
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
┌0
|
||||
┌1┤
|
||||
│ └2
|
||||
5┤
|
||||
└6┐
|
||||
└7
|
||||
|
||||
====================================
|
||||
|
||||
#14
|
||||
a-3-1-2-6-4-7-0-5 r-3-4-5-6-7
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
┌0
|
||||
1┤
|
||||
└2
|
||||
|
||||
====================================
|
||||
|
||||
#15
|
||||
a-3-1-2-6-4-7-0-5 r-3-4-5-6-7-1
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
┌0
|
||||
2┘
|
||||
|
||||
====================================
|
||||
|
||||
#16
|
||||
a-3-1-2-6-4-7-0-5 r-3-4-5-6-7-1-2
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
0
|
||||
|
||||
====================================
|
||||
|
||||
#17
|
||||
a-3-1-2-6-4-7-0-5 r-3-4-5-6-7-1-2-0
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
====================================
|
||||
|
||||
#18
|
||||
a-3-1-2-6-4-7 r-3 a-3
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
┌1┐
|
||||
│ └2┐
|
||||
│ └3
|
||||
4┤
|
||||
└6┐
|
||||
└7
|
||||
|
||||
====================================
|
||||
|
||||
#19
|
||||
a-3-1-2-6-4-7 r-3 a-3 r-2 a-2
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
┌1┐
|
||||
│ │ ┌2
|
||||
│ └3┘
|
||||
4┤
|
||||
└6┐
|
||||
└7
|
||||
|
||||
====================================
|
||||
|
||||
#20
|
||||
a-3-1-2-6-4-7 r-3 a-3 r-2 a-2 r-6
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
┌1┐
|
||||
│ │ ┌2
|
||||
│ └3┘
|
||||
4┤
|
||||
└7
|
||||
|
||||
====================================
|
||||
|
@ -0,0 +1,20 @@
|
||||
a-3;3
|
||||
a-3-1-2-6-4-7-0-5; ┌0~ ┌1┤~ │ └2~3┤~ │ ┌4┐~ │ │ └5~ └6┤~ └7
|
||||
a-3-1-2-6-4-7-0-5 r-3; ┌0~ ┌1┤~ │ └2~4┤~ │ ┌5~ └6┤~ └7
|
||||
a-3-1-2-6-4-7-0-5 r-3-5; ┌0~ ┌1┤~ │ └2~4┤~ └6┐~ └7
|
||||
a-3-1-2-6-4-7-0-5 r-3-5-4; ┌0~ ┌1┤~ │ └2~6┤~ └7
|
||||
a-3-1-2-6-4-7-0-5 r-3-5-4-1; ┌0~ ┌2┘~6┤~ └7
|
||||
a-3-1-2-6-4-7-0 r-3-5-4-1; ┌0~ ┌2┘~6┤~ └7
|
||||
a-3-1-2-6-4-7-0-5 r-3-5-4-1-6-7-2-0-0 a-3-2; ┌2~3┘
|
||||
a-3-3-2-2-1-1 r-2-1;3
|
||||
a-3-3-1-1; ┌1~3┘
|
||||
a-3-1-2-6-4-7-0-5 r-3-4-5-6; ┌0~ ┌1┤~ │ └2~7┘
|
||||
a-3-12-116-14-7-0-5 r-3; ┌0~5┤~ │ ┌7~ └12┤~ │ ┌14~ └116┘
|
||||
a-3-1-2-6-4-7-0-5 r-3-4; ┌0~ ┌1┤~ │ └2~5┤~ └6┐~ └7
|
||||
a-3-1-2-6-4-7-0-5 r-3-4-5-6-7; ┌0~1┤~ └2
|
||||
a-3-1-2-6-4-7-0-5 r-3-4-5-6-7-1; ┌0~2┘
|
||||
a-3-1-2-6-4-7-0-5 r-3-4-5-6-7-1-2;0
|
||||
a-3-1-2-6-4-7-0-5 r-3-4-5-6-7-1-2-0;
|
||||
a-3-1-2-6-4-7 r-3 a-3; ┌1┐~ │ └2┐~ │ └3~4┤~ └6┐~ └7
|
||||
a-3-1-2-6-4-7 r-3 a-3 r-2 a-2; ┌1┐~ │ │ ┌2~ │ └3┘~4┤~ └6┐~ └7
|
||||
a-3-1-2-6-4-7 r-3 a-3 r-2 a-2 r-6; ┌1┐~ │ │ ┌2~ │ └3┘~4┤~ └7
|
|
2
semester-4/ОПJа/lb-4/task4/src/test/resources/uk.props
Normal file
2
semester-4/ОПJа/lb-4/task4/src/test/resources/uk.props
Normal file
@ -0,0 +1,2 @@
|
||||
table = \u0441\u0442\u0456\u043b
|
||||
apple = \u044f\u0431\u043b\u0443\u043a\u043e
|
BIN
semester-4/ОПJа/lb-4/tasks.pdf
Normal file
BIN
semester-4/ОПJа/lb-4/tasks.pdf
Normal file
Binary file not shown.
Reference in New Issue
Block a user