diff --git a/libraries/palindrome/CHANGELOG.md b/libraries/palindrome/CHANGELOG.md index 17f4cc9a..6e3ad1ed 100644 --- a/libraries/palindrome/CHANGELOG.md +++ b/libraries/palindrome/CHANGELOG.md @@ -6,12 +6,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.1.3] - 2023-11-14 +- update readme.md + + ## [0.1.2] - 2022-11-19 - add RP2040 in build-CI - add changelog.md - update keywords.txt - ## [0.1.1] - 2021-12-03 - add palindromeCount() - add palindromePercentage() diff --git a/libraries/palindrome/keywords.txt b/libraries/palindrome/keywords.txt index 91597092..77288879 100644 --- a/libraries/palindrome/keywords.txt +++ b/libraries/palindrome/keywords.txt @@ -5,10 +5,12 @@ palindrome KEYWORD1 # Methods and Functions (KEYWORD2) +isPalindrome KEYWORD2 + findPalindrome KEYWORD2 findEvenPalindrome KEYWORD2 findOddPalindrome KEYWORD2 -isPalindrome KEYWORD2 + palindromeCount KEYWORD2 palindromePercentage KEYWORD2 diff --git a/libraries/palindrome/library.json b/libraries/palindrome/library.json index ba55f72f..66f06a7c 100644 --- a/libraries/palindrome/library.json +++ b/libraries/palindrome/library.json @@ -15,9 +15,9 @@ "type": "git", "url": "https://github.com/RobTillaart/palindrome.git" }, - "version": "0.1.2", + "version": "0.1.3", "license": "MIT", - "frameworks": "arduino", + "frameworks": "*", "platforms": "*", "headers": "palindrome.h" } diff --git a/libraries/palindrome/library.properties b/libraries/palindrome/library.properties index 94057049..47146391 100644 --- a/libraries/palindrome/library.properties +++ b/libraries/palindrome/library.properties @@ -1,5 +1,5 @@ name=palindrome -version=0.1.2 +version=0.1.3 author=Rob Tillaart maintainer=Rob Tillaart sentence=Palindrome library diff --git a/libraries/palindrome/palindrome.cpp b/libraries/palindrome/palindrome.cpp index 9e69dfca..ee4ba2e2 100644 --- a/libraries/palindrome/palindrome.cpp +++ b/libraries/palindrome/palindrome.cpp @@ -1,7 +1,7 @@ // // FILE: palindrome.cpp // AUTHOR: Rob Tillaart -// VERSION: 0.1.2 +// VERSION: 0.1.3 // PURPOSE: Arduino library to do palindrome experiments. // URL: https://github.com/RobTillaart/palindrome @@ -139,10 +139,10 @@ float palindrome::palindromePercentage(const char * str) if (str == NULL) return 0; int sl = strlen(str); if (sl == 0) return 0; - if (sl % 2 == 1) sl++; // correction for odd length strings + if (sl % 2 == 1) sl++; // correction for odd length strings return (200.0 * palindromeCount(str)) / sl; } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/libraries/palindrome/palindrome.h b/libraries/palindrome/palindrome.h index fe3d108a..6f7aa9d7 100644 --- a/libraries/palindrome/palindrome.h +++ b/libraries/palindrome/palindrome.h @@ -2,7 +2,7 @@ // // FILE: palindrome.h // AUTHOR: Rob Tillaart -// VERSION: 0.1.2 +// VERSION: 0.1.3 // PURPOSE: Arduino library to do palindrome experiments. // URL: https://github.com/RobTillaart/palindrome // @@ -10,7 +10,7 @@ #include "Arduino.h" -#define PALINDROME_LIB_VERSION (F("0.1.2")) +#define PALINDROME_LIB_VERSION (F("0.1.3")) class palindrome @@ -32,6 +32,6 @@ class palindrome }; -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/libraries/palindrome/readme.md b/libraries/palindrome/readme.md index 88c66df8..92af0175 100644 --- a/libraries/palindrome/readme.md +++ b/libraries/palindrome/readme.md @@ -2,8 +2,11 @@ [![Arduino CI](https://github.com/RobTillaart/palindrome/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci) [![Arduino-lint](https://github.com/RobTillaart/palindrome/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/palindrome/actions/workflows/arduino-lint.yml) [![JSON check](https://github.com/RobTillaart/palindrome/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/palindrome/actions/workflows/jsoncheck.yml) +[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/palindrome.svg)](https://github.com/RobTillaart/palindrome/issues) + [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/palindrome/blob/master/LICENSE) [![GitHub release](https://img.shields.io/github/release/RobTillaart/palindrome.svg?maxAge=3600)](https://github.com/RobTillaart/palindrome/releases) +[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/palindrome.svg)](https://registry.platformio.org/libraries/robtillaart/palindrome) # Palindrome @@ -16,17 +19,30 @@ Library for palindrome search The palindrome library can test if a string is a palindrome and is able to find the longest palindrome within a character string. +This library is written mainly for some educational purpose, however other +applications are possible. Please share your ideas. + + +#### tests + The library is tested with an Arduino UNO, random string of 1600 characters. +(TODO performance compare) + ## Interface +```cpp +#include "palindrome.h" +``` + - **palindrome()** constructor. - **int findPalindrome(const char \* str, int & position, int & length)** find the longest palindrome in a string. (first occurrence). - **int findEvenPalindrome(const char \* str, int & position, int & length)** find the longest palindrome in a string with even length. (first occurrence). - **int findOddPalindrome(const char \* str, int & position, int & length)** find the longest palindrome in a string with odd length. (first occurrence). - **bool isPalindrome(const char \* str)** checks if a string is a palindrome. -- **int palindromeCount(const char \* str)** returns the count of matching pairs in a string. This is at most the ```length / 2 + 1```. +- **int palindromeCount(const char \* str)** returns the count of matching pairs in a string. +This is at most the ```length / 2 + 1```. - **float palindromePercentage(const char \* str)** returns the count as percentage 0.0 .. 100.0 % @@ -42,8 +58,14 @@ The examples show the basic working of the functions. ## Future +#### Must + - update documentation -- should this be a class? + +#### Should + +#### Could + - function names? - palindromeCount -- symmetryCount? - palindromePercentage -- symmetryPercentage? @@ -54,3 +76,14 @@ The examples show the basic working of the functions. - investigate case (in)sensitive flag? - investigate ignore spaces flag? +#### Wont + + +## Support + +If you appreciate my libraries, you can support the development and maintenance. +Improve the quality of the libraries by providing issues and Pull Requests, or +donate through PayPal or GitHub sponsors. + +Thank you, +