Collection_extensions.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef _Collection_extensions_h_
  2. #define _Collection_extensions_h_
  3. /* Collection_extensions.h
  4. *
  5. * Copyright (C) 1994-2017 David Weenink, 2015,2018 Paul Boersma
  6. *
  7. * This code is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * This code is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #include "Collection.h"
  21. #include "Graphics.h"
  22. #include "Permutation.h"
  23. autoCollection Collection_Permutation_permuteItems (Collection me, Permutation him);
  24. autoCollection Collection_permuteItems (Collection me);
  25. /* permute the order of my items */
  26. int OrderedOfString_append (StringList me, conststring32 append);
  27. autoStringList OrderedOfString_joinItems (StringList me, StringList thee);
  28. /* Join each item */
  29. autoStringSet StringList_to_StringSet (StringList me);
  30. double OrderedOfString_getFractionDifferent (StringList me, StringList thee);
  31. integer OrderedOfString_getNumberOfDifferences (StringList me, StringList thee);
  32. integer OrderedOfString_indexOfItem_c (StringList me, conststring32 str);
  33. void OrderedOfString_initWithSequentialNumbers (StringList me, integer n);
  34. void OrderedOfString_removeOccurrences (StringList me, conststring32 search, bool use_regexp);
  35. void OrderedOfString_changeStrings (StringList me, char32 *search, char32 *replace,
  36. int maximumNumberOfReplaces, integer *nmatches, integer *nstringmatches, bool use_regexp);
  37. integer OrderedOfString_isSubsetOf (StringList me, StringList thee, integer *translation);
  38. /* Check whether my items are (a subset of)|(in) thy items.
  39. * Preconditions:
  40. * if (translation) translation[1..my size] exists.
  41. * Postconditions:
  42. * Return: the number of my labels that are in thee.
  43. * if (translation) the returned translation table has the following property:
  44. * if (translation[i] > 0) my label[i] = thy label[ translation[i] ];
  45. * else if (translation[i] == 0) my label[i] not in thy labels.
  46. */
  47. #endif /* _Collection_extensions_h_ */